MON 서버가 현재 2개가 존재하는데, 한개 더 추가하는 작업을 진행해보도록 하겠습니다.
현재 상태
[root@mon-0 ~]# ceph -s
cluster f34c394f-8591-4d25-9a09-81c0341ce672
health HEALTH_OK
monmap e1: 2 mons at {mgmt=10.1.0.5:6789/0,mon-0=10.1.0.7:6789/0}
election epoch 4, quorum 0,1 mgmt,mon-0
osdmap e55: 4 osds: 4 up, 4 in
flags sortbitwise,require_jewel_osds
pgmap v193: 64 pgs, 1 pools, 0 bytes data, 0 objects
432 MB used, 81443 MB / 81875 MB avail
64 active+clean
[root@mgmt ~]# ceph-deploy new mon-1
[root@mgmt ~]# ceph-deploy install --repo-url 'https://download.ceph.com/rpm-jewel/el7' --gpg-url 'https://download.ceph.com/keys/release.asc' mon-1
[root@mgmt ~]# cat ceph.conf
[global]
fsid = f34c394f-8591-4d25-9a09-81c0341ce672
mon_initial_members = mgmt, mon-0
mon_host = 10.1.0.5,10.1.0.7
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true
osd_pool_default_size = 2
rbd_default_features = 1
osd_journal_size = 10240
osd_pool_default_pg_num = 128
osd_pool_default_pgp_num = 128
public_network=10.1.0.0/24
[mon]
mon_host = mgmt, mon-0, mon-1
mon_addr = 10.1.0.5,10.1.0.7, 10.1.0.8
mon_clock_drift_allowed = .3
mon_clock_drift_warn_backoff = 30 # Tell the monitor to backoff from this warning for 30 seconds
mon_osd_full_ratio = .90
mon_osd_nearfull_ratio = .85
mon_osd_report_timeout = 300
debug_ms = 1
debug_mon = 20
debug_paxos = 20
debug_auth = 20
[mon.0]
host = mgmt
mon_addr = 10.1.0.5:6789
[mon.1]
host = mon-0
mon_addr = 10.1.0.7:6789
[mon.2]
host = mon-1
mon_addr = 10.1.0.8:6789
[mds]
mds_standby_replay = true
mds_cache_size = 250000
debug_ms = 1
debug_mds = 20
debug_journaler = 20
[mds.0]
host = mds
[osd.0]
host = osd-0
[osd.1]
host = osd-1
[osd.2]
host = osd-2
[osd.3]
host = osd-3
mgmt에서 ceph.client.admin.keyring 파일과, 수정한 ceph.conf 파일을 mon-1 서버로 갖고옵니다.
[root@mgmt ~]# sftp mon-1
Connected to mon-1.
sftp> put ceph.client.admin.keyring
Uploading ceph.client.admin.keyring to /root/ceph.client.admin.keyring
ceph.client.admin.keyring 100% 129 63.4KB/s 00:00
sftp> put ceph.conf
Uploading ceph.conf to /root/ceph.conf
ceph.conf 100% 1036 980.5KB/s 00:00
그 상태에서 MON-1을 배포합니다.
[root@mgmt ~]# ceph-deploy --overwrite-conf mon create mon-1
[ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf
[ceph_deploy.cli][INFO ] Invoked (1.5.39): /usr/bin/ceph-deploy --overwrite-conf mon create mon-1
[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 : create
[ceph_deploy.cli][INFO ] quiet : False
[ceph_deploy.cli][INFO ] cd_conf : <ceph_deploy.conf.cephdeploy.Conf instance at 0x7fe448e00560>
[ceph_deploy.cli][INFO ] cluster : ceph
[ceph_deploy.cli][INFO ] mon : ['mon-1']
[ceph_deploy.cli][INFO ] func : <function mon at 0x7fe448dd8758>
[ceph_deploy.cli][INFO ] ceph_conf : None
[ceph_deploy.cli][INFO ] default_release : False
[ceph_deploy.cli][INFO ] keyrings : None
[ceph_deploy.mon][DEBUG ] Deploying mon, cluster ceph hosts mon-1
[ceph_deploy.mon][DEBUG ] detecting platform for host mon-1 ...
[root@mon-1 ~]# ll /var/lib/ceph/mon
합계 0
drwxr-xr-x 3 ceph ceph 60 6월 27 15:01 ceph-mon-1
[root@mon-1 ~]# ll /var/lib/ceph/mon/ceph-mon-1/
합계 4
-rw-r--r-- 1 ceph ceph 0 6월 27 15:03 done
-rw------- 1 ceph ceph 77 6월 27 15:01 keyring
drwxr-xr-x 2 ceph ceph 87 6월 27 15:01 store.db
-rw-r--r-- 1 ceph ceph 0 6월 27 15:01 systemd
기존 디렉토리를 bak 으로 복사한뒤에 임시 디렉토리를 생성해줍니다.
[root@mon-1 mon]# mv /var/lib/ceph/mon/ceph-mon-1/ /var/lib/ceph/mon/ceph-mon-1_bak
[root@mon-1 mon]# mkdir /var/lib/ceph/mon/ceph-mon-1_bak/tmp
해당 경로로 이동 후, 새 mon서버를 monmap에 추가해줍니다.
[root@mon-1 mon]# cd /var/lib/ceph/mon/ceph-mon-1_bak/
[root@mon-1 ceph-mon-1_bak]# monmaptool --create --add mon-1 10.1.0.8:6789 --clobber tmp/monmap
monmaptool: monmap file tmp/monmap
monmaptool: generated fsid a699a2ed-db7c-44b2-908b-662db1ef56ab
monmaptool: writing epoch 0 to tmp/monmap (1 monitors)
monitor keyring을 검색합니다.
[root@mon-1 ceph-mon-1_bak]# ceph-mon -i mon-1 --mkfs --monmap tmp/monmap --keyring tmp/keyring
ceph-mon: set fsid to f34c394f-8591-4d25-9a09-81c0341ce672
ceph-mon: created monfs at /var/lib/ceph/mon/ceph-mon-1 for mon.mon-1
새로 생성된 mon-1 디렉토리의 권한을 ceph 계정으로 변경해줍니다.
[root@mon-1 ceph-mon-1_bak]# chown -R ceph.ceph ../ceph-mon-1
[root@mon-1 ceph-mon-1_bak]# ll /var/lib/ceph/mon
합계 0
drwxr-xr-x 3 ceph ceph 35 6월 27 15:15 ceph-mon-1
drwxr-xr-x 4 ceph ceph 70 6월 27 15:05 ceph-mon-1_bak
새 MON 서버를 시작합니다.
[root@mon-1 ceph-mon-1_bak]# ceph-mon -i mon-1 --public-addr 10.1.0.8:6789
상태값을 확인해보면 정상적으로 mon-1이 들어간 것을 확인해볼 수 있습니다.
[root@mon-1 ceph-mon-1_bak]# ceph -s
cluster f34c394f-8591-4d25-9a09-81c0341ce672
health HEALTH_OK
monmap e2: 3 mons at {mgmt=10.1.0.5:6789/0,mon-0=10.1.0.7:6789/0,mon-1=10.1.0.8:6789/0}
election epoch 6, quorum 0,1,2 mgmt,mon-0,mon-1
osdmap e55: 4 osds: 4 up, 4 in
flags sortbitwise,require_jewel_osds
pgmap v193: 64 pgs, 1 pools, 0 bytes data, 0 objects
432 MB used, 81443 MB / 81875 MB avail
64 active+clean
[root@mon-1 ceph-mon-1_bak]# ceph mon dump
dumped monmap epoch 2
epoch 2
fsid f34c394f-8591-4d25-9a09-81c0341ce672
last_changed 2020-06-27 15:16:04.340916
created 2020-06-27 12:55:45.372522
0: 10.1.0.5:6789/0 mon.mgmt
1: 10.1.0.7:6789/0 mon.mon-0
2: 10.1.0.8:6789/0 mon.mon-1
'BlockStorage(Ceph)' 카테고리의 다른 글
Ceph OSD 리부팅 (0) | 2020.06.30 |
---|---|
CEPH OSD 제거 (2) | 2020.06.29 |
CRUSHMAP 수동으로 설정 변경 (0) | 2020.06.08 |
CEPH pool, crush rule, bucket 생성 (0) | 2020.06.08 |
CEPH 설치 (0) | 2020.05.31 |