Created
February 20, 2014 06:22
-
-
Save srockstyle/9108023 to your computer and use it in GitHub Desktop.
CentOSでMySQL5.5いれてマルチマスターレプリケーション組むまで ref: http://qiita.com/srockstyle/items/8bed9550be75bf2e5e14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## EpelとRemiを入れる | |
| rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
| rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## MySQLの5.5をremiから | |
| yum --enablerepo=remi install mysql-server mysql mysql-libs mysql-devel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CHANGE MASTER TO | |
| MASTER_HOST = '{MASTERHOSTNAME}', | |
| MASTER_USER = '{MASTERUSERNAME}', | |
| MASTER_PASSWORD = '{MASTERPASSWORD}' | |
| MASTER_PORT={CONNECTPORT}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## スレーブユーザの登録 | |
| GRANT REPLICATION SLAVE ON *.* TO 'slave-user'@'%' IDENTIFIED BY 'slave-password'; | |
| ## マスターの指定 | |
| CHANGE MASTER TO MASTER_HOST = '[IPADDRESS]', MASTER_USER = '[USER]', MASTER_PASSWORD = '[PASSWORD]',MASTER_PORT=3306; | |
| ## スレーブの開始 | |
| start slave; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| master-host= [もう一台のサーバのIP] | |
| master-port=3306 | |
| master-user=[スレーブ用のユーザ] | |
| master-password=[パスワード] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment