LoginSignup
2
1

More than 5 years have passed since last update.

Percona ClusterをChefでインストールする

Last updated at Posted at 2016-05-03

初めに

最近Ruby、Ruby on RailsやChefを仕事でも触りだし、PerconaのクラスタリングをChefで行ったのでメモとして手順を残すために投稿。

対象Percona

Percona XtraDB Cluster 5.6x

対象OS

  • CentOS 6.x
  • CentOS 7.x

事前準備

手順

作業は全てサーバ上(192.168.1.10)から行う

 site-cookbooksへ下記レシピ(Percona_Cluster)を追加

$ git clone https://github.com/UsamiDenki/Percona_Cluster.git

 対象クライアントサーバ用の共通roleを用意

$ vi roles/percona_cluster.json
{
  "chef_type": "role",
  "json_class": "Chef::Role",
  "default_attributes": {
    "percona_cluster": {
       "root_password": "mysql",
       "wsrep_cluster_addresses": [ "192.168.1.31", "192.168.1.32", "192.168.1.33" ],
       "wsrep_cluster_name": "my_cluster",
       "wsrep_sst_auth": "sstuser:s3cret"
    }
  },
  "run_list": [
    "recipe[Percona_Cluster]"
  ]
}

 対象クライアントサーバ用のnodeを用意

  • クライアントサーバ1
$ vi nodes/192.168.1.31.json
{
    "percona_cluster": {
        "wsrep_node_address": "192.168.1.31"
    },
    "run_list": [
        "role[percona_cluster]"
    ]
}
  • クライアントサーバ2
$ vi nodes/192.168.1.32.json
{
    "percona_cluster": {
        "wsrep_node_address": "192.168.1.32"
    },
    "run_list": [
        "role[percona_cluster]"
    ]
}
  • クライアントサーバ3
$ vi nodes/192.168.1.33.json
{
    "percona_cluster": {
        "wsrep_node_address": "192.168.1.33"
    },
    "run_list": [
        "role[percona_cluster]"
    ]
}

 全クライアントサーバへChef-Soloをインストール

$ knife solo prepare root@192.168.1.31

各クライアントサーバへrootログインできる前提

 全クライアントサーバへChefからPercona XtraDB Cluster 5.6xをインストール

$ knife solo cook root@192.168.1.31

192.168.1.31から.33まで順に実施する

クラスタされているかテストして完了

確認方法はCentOS6.7にPercona XtraDB Clusterをインストールするを参照

注意

$ yum update

するとPerconaがconflictsするので/etc/yum.confにexcludeを追加すると回避できるが、設定次第でPerconaがyumから除外されてしまうので注意。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1