SHARE
TWEET

Untitled

a guest Oct 2nd, 2017 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _______________MASTER_______________
  2. yum install epel-release
  3.  
  4. yum -y install mariadb-server mariadb
  5. systemctl start mariadb.service
  6. systemctl enable mariadb.service
  7. mysql_secure_installation
  8. nano /etc/my.cnf
  9.     [mysqld]
  10.     log-bin=mysql-bin
  11.     server-id=101
  12. systemctl restart mariadb
  13. mysql -u root -p
  14.     create user AMI@DOMAIN identified by 'passowrd';
  15.     stop slave;
  16.     grant replication slave on *.* to namauser@'%' identified by 'passwordnya';
  17.     flush privileges;
  18. firewall-cmd --permanent --add-service=mysql
  19. firewall-cmd --reload
  20.  
  21.  
  22. ______________SLAVE______________
  23. yum install epel-release
  24.  
  25. yum -y install mariadb-server mariadb
  26. systemctl start mariadb.service
  27. systemctl enable mariadb.service
  28. mysql_secure_installation
  29. nano /etc/my.cnf
  30.     [mysqld]
  31.     log-bin=mysql-bin
  32.     server-id=102
  33.     report-host=DOMAIN_SLAVE
  34. systemctl restart mariadb
  35. firewall-cmd --permanent --add-service=mysql
  36. firewall-cmd --reload
  37.  
  38.  
  39.  
  40. ____________MASTER____________
  41. mysql -u root -p
  42.     flush tables with read lock;
  43.     show master status;
  44. mysqldump -u root -p --all-databases --lock-all-tables --events > mysql_dump.sql
  45. mysql -u root -p
  46.     unlock tables;
  47.     quit
  48. scp mysql_dump.sql DOMAIN_SLAVE:/tmp/
  49.  
  50.  
  51.  
  52. ___________SLAVE_______________
  53. mysql -u root -p < /tmp/mysql_dump.sql
  54. mysql -u root -p
  55.     change master to
  56.     master_host='IP_MASTER',
  57.     master_user='AMI',
  58.     master_password='password',
  59.     master_log_file='mysql-bin.000002',
  60.     master_log_pos=123;
  61. start slave;
  62. show slave status\G;
  63. yes
  64. yes
  65.  
  66.  
  67. __________SLAVE WEB SERVER_________
  68. yum -y install httpd
  69. systemctl start httpd.service
  70. systemctl enable httpd.service
  71. firewall-cmd --permanent --zone=public --add-service=http
  72. firewall-cmd --permanent --zone=public --add-service=https
  73. firewall-cmd --permanent --zone=public --add-port=80/tcp&udp
  74. firewall-cmd --reload
  75. test
  76.  
  77. yum -y install php
  78. systemctl restart httpd.service
  79. vi /var/www/html/info.php
  80. http://ip/info.php
  81.  
  82. yum -y install php-mysql
  83. yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
  84. systemctl restart httpd.service
  85. http://ip/info.php
  86.  
  87. ___________MASTER_______________
  88.     create database wordpress;
  89.  
  90. __________SLAVE WEB SERVER___________
  91. mysql -u root -p
  92.     create user userwp@localhost identified by 'password';
  93.     grant all privileges on wordpress.* TO userwp@localhost IDENTIFIED BY 'password';
  94.     FLUSH PRIVILEGES;
  95.     exit
  96.  
  97. yum install php-gd
  98. service httpd restart
  99. wget http://wordpress.org/latest.tar.gz
  100. tar xzvf latest.tar.gz
  101. yum install rsync -y
  102. rsync -avP ~/wordpress/ /var/www/html/
  103. mkdir /var/www/html/wp-content/uploads
  104. chown -R apache:apache /var/www/html/*
  105. cp wp-config-sample.php wp-config.php
  106. nano wp-config.php
  107.     define('DB_NAME', 'wordpress');
  108.     define('DB_USER', 'wordpressuser');
  109.     define('DB_PASSWORD', 'password');
  110. systemctl restart httpd
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top