Skip to content

Instantly share code, notes, and snippets.

@srockstyle
Created February 20, 2014 06:22
Show Gist options
  • Select an option

  • Save srockstyle/9108023 to your computer and use it in GitHub Desktop.

Select an option

Save srockstyle/9108023 to your computer and use it in GitHub Desktop.
CentOSでMySQL5.5いれてマルチマスターレプリケーション組むまで ref: http://qiita.com/srockstyle/items/8bed9550be75bf2e5e14
## 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
## MySQLの5.5をremiから
yum --enablerepo=remi install mysql-server mysql mysql-libs mysql-devel
CHANGE MASTER TO
MASTER_HOST = '{MASTERHOSTNAME}',
MASTER_USER = '{MASTERUSERNAME}',
MASTER_PASSWORD = '{MASTERPASSWORD}'
MASTER_PORT={CONNECTPORT};
## スレーブユーザの登録
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;
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