Database Server
Database Server
Primary Database Server
ssh [email protected] sudo -s127.0.0.1 db01.med.university.edudb01.med.university.eduyum install screen screen yum update rebootssh [email protected] sudo -s screen yum -y install https://repo.ius.io/ius-release-el7.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmyum install mariadb104 mariadb104-server ntp[mysqld] # Innodb innodb_buffer_pool_size = 6G # main memory buffer of Innodb, very imporant innodb_log_file_size = 256M # transactional journal size innodb_flush_method = O_DIRECT # avoid double buffering with the OS innodb_flush_log_at_trx_commit = 2 # writes to OS, fsynced once per second innodb_buffer_pool_load_at_startup = on innodb_buffer_pool_dump_at_shutdown = on innodb_ft_min_token_size = 3 # Basic Settings thread_cache_size = 8 table_open_cache = 4000 table_definition_cache = 1800 query_cache_size = 64M query_cache_type = 1 max_allowed_packet = 8388608 sql_mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" # MariaDB performance tuning options for more connections. (OPTIONAL) #max_connections = 512 # Replication (OPTIONAL) #server_id = 1012801 # the ip address of the server is a good idea. #log_bin = /var/lib/mysql/mysql-bin #expire_logs_days = 14 #sync_binlog = 4 # 1: with every transaction 4 or 5: every 4th or 5th transaction. # Slow Query Logging / Tuning slow_query_log = on slow_query_log_file = /var/log/mysqld-slow-queries.log log_slow_verbosity = 'innodb,query_plan' long_query_time = 7 performance_schema = onmkdir -p /usr/lib/systemd/system/mariadb.service.d vim /usr/lib/systemd/system/mariadb.service.d/limit_nofile.conf[Service] LimitNOFILE=4096systemctl daemon-reload systemctl enable mariadb systemctl start mariadb/usr/bin/mysql_secure_installation[root@db01]# /usr/bin/mysql_secure_installation /usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!mysql -uroot -pCREATE DATABASE `elentra_auth` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE DATABASE `elentra_admissions` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE DATABASE `elentra_cpd` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE DATABASE `elentra_me` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE DATABASE `elentra_me_clerkship` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE DATABASE `elentra_cbe` CHARACTER SET utf8 COLLATE utf8_general_ci; -- DO NOT FORGET to change the password in the following line. CREATE USER 'elentra'@'localhost' IDENTIFIED BY 'your-password-needs-to-go-here'; GRANT ALL ON elentra_auth.* TO 'elentra'@'localhost'; GRANT ALL ON elentra_admissions.* TO 'elentra'@'localhost'; GRANT ALL ON elentra_cpd.* TO 'elentra'@'localhost'; GRANT ALL ON elentra_me.* TO 'elentra'@'localhost'; GRANT ALL ON elentra_me_clerkship.* TO 'elentra'@'localhost'; GRANT ALL ON elentra_cbe.* TO 'elentra'@'localhost'; FLUSH PRIVILEGES;GRANT REPLICATION SLAVE ON *.* TO 'repl'@'db02.med.university.edu' IDENTIFIED BY 'your-password-needs-to-go-here';SHOW MASTER STATUS \G
Replica Database Server
Last updated