21
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GlusterFS 3.7.2 でノード交換時の手順

Posted at

GlusterFS でノードの交換時(故障したノードを完全に新しいノードと交換するとき)の手順。

  • CentOS 7.1.1503
  • GlusterFS 3.7.2

3.4.0 以降だと不具合?のためか、巷でよく見る方法だと上手く復帰しませんでした。
Bug 991084 – No way to start a failed brick when replaced the location with empty folder


g1 g2 g3 g4 の4ノードで構成されていて、g1 が故障したので新しいものと交換したいとします。

g1 を新規に構築して glusterfs-server をインストールします。

適当な他のノードから、故障前の g1 の UUID を調べます。

ssh g2 gluster pool list

新規に構築した g1 の UUID を↑で調べた値に変更します。

vim /var/lib/glusterd/glusterd.info

ブリックを作ります。ディレクトリ名とかは適当に読み替えてください。

parted -s -a optimal /dev/sdb mklabel msdos -- mkpart primary xfs 1 -1
mkfs.xfs -i size=512 /dev/sdb1
mkdir -p /glfs/vols

cat <<EOS>>/etc/fstab
/dev/sdb1 /glfs/vols xfs defaults 0 0
EOS

mount /glfs/vols
mkdir -p /glfs/vols/data

glusterd を起動します。

systemctl enable glusterd.service
systemctl start  glusterd.service
systemctl status glusterd.service

g1 から g1 以外のすべてに gluster peer probe します。

gluster peer probe g2
gluster peer probe g3
gluster peer probe g4

gluster pool list で確認するとクラスタが復帰していることがわかります。

gluster pool list

これだけだとボリュームの情報が g1 に無いことがあるようです。

gluster volume list

そんなときは glusterd を再起動すると良いようです(gluster volume sync g2 all でもいいのかもしれない)。

systemctl stop  glusterd.service
systemctl start glusterd.service

ボリュームの情報が得られることを確認します。

gluster volume info data

なぜか gluster volume status data で見るとボリュームが Online になっていないことがあります。

gluster volume status data
    Status of volume: data
    Gluster process                             TCP Port  RDMA Port  Online  Pid
    ------------------------------------------------------------------------------
    Brick g1:/glfs/vols/data                    N/A       N/A        N       N/A  
    Brick g2:/glfs/vols/data                    49152     0          Y       2794 
    Brick g3:/glfs/vols/data                    49152     0          Y       2754 
    Brick g4:/glfs/vols/data                    49152     0          Y       2753
    ...snip...

そんなときは glusterd を再起動すると良い?らしい?です???

systemctl stop  glusterd.service
systemctl start glusterd.service

3.4.0 以降だとこれでもダメなようです。

このとき、ブリックのログに次のように記録されています。

[2015-07-14 05:59:08.521960] E [posix.c:6012:init] 0-data-posix: Extended attribute trusted.glusterfs.volume-id is absent
[2015-07-14 05:59:08.521972] E [xlator.c:426:xlator_init] 0-data-posix: Initialization of volume 'data-posix' failed, review your volfile again
[2015-07-14 05:59:08.521978] E [graph.c:322:glusterfs_graph_init] 0-data-posix: initializing translator failed
[2015-07-14 05:59:08.521983] E [graph.c:661:glusterfs_graph_activate] 0-graph: init failed
[2015-07-14 05:59:08.522710] W [glusterfsd.c:1219:cleanup_and_exit] (--> 0-: received signum (0), shutting down

ブリックのディレクトリに trusted.glusterfs.volume-id 拡張属性が無いためらしいのですが、次のコマンドで再生性できます。

gluster volume start data force

今度こそボリュームがオンラインになっていることを確認します。

gluster volume status data
    Status of volume: data
    Gluster process                             TCP Port  RDMA Port  Online  Pid
    ------------------------------------------------------------------------------
    Brick g1:/glfs/vols/data                    49153     0          Y       3281 
    Brick g2:/glfs/vols/data                    49152     0          Y       2794 
    Brick g3:/glfs/vols/data                    49152     0          Y       2754 
    Brick g4:/glfs/vols/data                    49152     0          Y       2753
    ...snip...

オンラインになっても自動的に再レプリケーションされません。

ll /glfs/vols/data/
    total 0

gluster volume heal <volume> full で再レプリケーションします。

gluster volume heal data full
    Launching heal operation to perform full self heal on volume data has been successful 
    Use heal info commands to check status

再レプリケーションされます。

ll /glfs/vols/data/
    total 4
    ...snip...    
21
18
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
21
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?