分布式存储系统之Ceph集群MDS扩展( 八 )


[cephadm@ceph-admin ceph-cluster]$ sefattr-bash: sefattr: command not found[cephadm@ceph-admin ceph-cluster]$ yum provides setfattrLoaded plugins: fastestmirrorRepository epel is listed more than once in the configurationRepository epel-debuginfo is listed more than once in the configurationRepository epel-source is listed more than once in the configurationLoading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.comattr-2.4.46-13.el7.x86_64 : Utilities for managing filesystem extended attributesRepo        : baseMatched from:Filename    : /usr/bin/setfattr [cephadm@ceph-admin ceph-cluster]$提示:前提是我们系统上要有setfattr命令,如果没有可以安装attr这个包即可;
MDS故障转移机制
出于冗余的目的,每个CephFS上都应该配置一定数量Standby状态的ceph-mds守护进程等着接替失效的rank,CephFS提供了四个选项用于控制Standby状态的MDS守护进程如何工作;
1、 mds_standby_replay:布尔型值,true表示当前MDS守护进程将持续读取某个特定的Up状态的rank的元数据日志,从而持有相关rank的元数据缓存,并在此rank失效时加速故障切换; 一个Up状态的rank仅能拥有一个replay守护进程,多出的会被自动降级为正常的非replay型MDS;
2、 mds_standby_for_name:设置当前MDS进程仅备用于指定名称的rank;
3、 mds_standby_for_rank:设置当前MDS进程仅备用于指定的rank,它不会接替任何其它失效的rank;不过,在有着多个CephFS的场景中,可联合使用下面的参数来指定为哪个文件系统的rank进行冗余;
4、 mds_standby_for_fscid:联合mds_standby_for_rank参数的值协同生效;同时设置了mds_standby_for_rank:备用于指定fscid的指定rank;未设置mds_standby_for_rank时:备用于指定fscid的任意rank;
配置冗余mds

分布式存储系统之Ceph集群MDS扩展

文章插图
提示:上述配置表示ceph-mon03这个冗余的mds开启对ceph-mon01做实时备份,但ceph-mon01故障,对应ceph-mon03自动接管ceph-mon01负责的rank;
推送配置到集群各主机
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy --overwrite-conf config push ceph-mon01 ceph-mon02 ceph-mon03 ceph-mgr01 ceph-mgr02[ceph_deploy.conf][DEBUG ] found configuration file at: /home/cephadm/.cephdeploy.conf[ceph_deploy.cli][INFO  ] Invoked (2.0.1): /bin/ceph-deploy --overwrite-conf config push ceph-mon01 ceph-mon02 ceph-mon03 ceph-mgr01 ceph-mgr02[ceph_deploy.cli][INFO  ] ceph-deploy options:[ceph_deploy.cli][INFO  ]  username                      : None[ceph_deploy.cli][INFO  ]  verbose                       : False[ceph_deploy.cli][INFO  ]  overwrite_conf                : True[ceph_deploy.cli][INFO  ]  subcommand                    : push[ceph_deploy.cli][INFO  ]  quiet                         : False[ceph_deploy.cli][INFO  ]  cd_conf                       : <ceph_deploy.conf.cephdeploy.Conf instance at 0x7f03332968c0>[ceph_deploy.cli][INFO  ]  cluster                       : ceph[ceph_deploy.cli][INFO  ]  client                        : ['ceph-mon01', 'ceph-mon02', 'ceph-mon03', 'ceph-mgr01', 'ceph-mgr02'][ceph_deploy.cli][INFO  ]  func                          : <function config at 0x7f03334c5cf8>[ceph_deploy.cli][INFO  ]  ceph_conf                     : None[ceph_deploy.cli][INFO  ]  default_release               : False[ceph_deploy.config][DEBUG ] Pushing config to ceph-mon01[ceph-mon01][DEBUG ] connection detected need for sudo[ceph-mon01][DEBUG ] connected to host: ceph-mon01[ceph-mon01][DEBUG ] detect platform information from remote host[ceph-mon01][DEBUG ] detect machine type[ceph-mon01][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[ceph_deploy.config][DEBUG ] Pushing config to ceph-mon02[ceph-mon02][DEBUG ] connection detected need for sudo[ceph-mon02][DEBUG ] connected to host: ceph-mon02[ceph-mon02][DEBUG ] detect platform information from remote host[ceph-mon02][DEBUG ] detect machine type[ceph-mon02][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[ceph_deploy.config][DEBUG ] Pushing config to ceph-mon03[ceph-mon03][DEBUG ] connection detected need for sudo[ceph-mon03][DEBUG ] connected to host: ceph-mon03[ceph-mon03][DEBUG ] detect platform information from remote host[ceph-mon03][DEBUG ] detect machine type[ceph-mon03][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[ceph_deploy.config][DEBUG ] Pushing config to ceph-mgr01[ceph-mgr01][DEBUG ] connection detected need for sudo[ceph-mgr01][DEBUG ] connected to host: ceph-mgr01[ceph-mgr01][DEBUG ] detect platform information from remote host[ceph-mgr01][DEBUG ] detect machine type[ceph-mgr01][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[ceph_deploy.config][DEBUG ] Pushing config to ceph-mgr02[ceph-mgr02][DEBUG ] connection detected need for sudo[ceph-mgr02][DEBUG ] connected to host: ceph-mgr02[ceph-mgr02][DEBUG ] detect platform information from remote host[ceph-mgr02][DEBUG ] detect machine type[ceph-mgr02][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[cephadm@ceph-admin ceph-cluster]$

经验总结扩展阅读