このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
01_linux:13_storage:38_cephadm [2022/11/16 04:03] – 作成 matsui | 01_linux:13_storage:38_cephadm [2022/11/17 06:30] (現在) – matsui | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 38 cephadmでcephインストール ====== | + | ====== 38 cephadmでcephインストール後、openstackで利用 |
+ | ===== 1.Ceph install ===== | ||
- | {{tag> | + | ==== cephadm install ==== |
+ | |||
+ | < | ||
+ | # curl --silent --remote-name --location https:// | ||
+ | # chmod +x cephadm | ||
+ | </ | ||
+ | |||
+ | ==== add repogitory ==== | ||
+ | |||
+ | < | ||
+ | # echo deb https:// | ||
+ | # wget -q -O- ' | ||
+ | # apt update | ||
+ | </ | ||
+ | |||
+ | === quincy === | ||
+ | |||
+ | < | ||
+ | # echo deb https:// | ||
+ | # wget -q -O- ' | ||
+ | # apt update | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== install cephadm ==== | ||
+ | # ./cephadm install | ||
+ | |||
+ | ==== initial bootstrap ceph ==== | ||
+ | |||
+ | 192.168.0.101は、ストレージネットワーク | ||
+ | |||
+ | < | ||
+ | # mkdir -p /etc/ceph | ||
+ | # cephadm bootstrap --mon-ip 192.168.0.101 --initial-dashboard-user admin --initial-dashboard-password XXXXX | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== install ceph-common ==== | ||
+ | |||
+ | # apt install ceph-common | ||
+ | |||
+ | |||
+ | ==== cephadmにホスト登録しラベル付け ==== | ||
+ | |||
+ | < | ||
+ | ssh-copy-id -f -i / | ||
+ | ssh-copy-id -f -i / | ||
+ | ssh-copy-id -f -i / | ||
+ | |||
+ | ceph orch host add ceph01 192.168.0.101 | ||
+ | ceph orch host add ceph02 192.168.0.102 | ||
+ | ceph orch host add ceph03 192.168.0.103 | ||
+ | |||
+ | ceph orch host label ceph01 mon | ||
+ | ceph orch host label ceph02 mon | ||
+ | ceph orch host label ceph03 mon | ||
+ | ceph orch host label ceph01 osd | ||
+ | ceph orch host label ceph02 osd | ||
+ | ceph orch host label ceph03 osd | ||
+ | ceph orch host label ceph01 mgr | ||
+ | </ | ||
+ | |||
+ | === 確認 === | ||
+ | |||
+ | < | ||
+ | # ceph orch host ls | ||
+ | HOST | ||
+ | ceph01 192.168.0.101 | ||
+ | ceph02 192.168.0.102 | ||
+ | ceph03 192.168.0.103 | ||
+ | 3 hosts in cluster | ||
+ | </ | ||
+ | |||
+ | ==== configファイル用意 ==== | ||
+ | |||
+ | < | ||
+ | # vim ceph_cluster_conf.yaml | ||
+ | service_type: | ||
+ | placement: | ||
+ | count: 3 | ||
+ | label: mon | ||
+ | --- | ||
+ | service_type: | ||
+ | placement: | ||
+ | count: 1 | ||
+ | label: mgr | ||
+ | --- | ||
+ | service_type: | ||
+ | service_id: osd_using_paths | ||
+ | placement: | ||
+ | hosts: | ||
+ | - ceph01 | ||
+ | - ceph02 | ||
+ | - ceph03 | ||
+ | spec: | ||
+ | data_devices: | ||
+ | paths: | ||
+ | - /dev/sdb | ||
+ | - /dev/sdc | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== デプロイ ==== | ||
+ | |||
+ | # ceph orch apply -i ceph_cluster_conf.yaml | ||
+ | |||
+ | 下記で見ているとだんだんcephが構築されていってるのが見える | ||
+ | |||
+ | watch ceph -s | ||
+ | |||
+ | |||
+ | === cephadmでceph.confを持ってくる場合 === | ||
+ | |||
+ | cephadm shell cat / | ||
+ | |||
+ | |||
+ | ===== 2 openstack用設定 ===== | ||
+ | |||
+ | ==== openstack用のpoolを用意しておく ==== | ||
+ | |||
+ | < | ||
+ | # ceph osd pool create volumes | ||
+ | # ceph osd pool create images | ||
+ | # ceph osd pool create backups | ||
+ | # ceph osd pool create vms | ||
+ | |||
+ | # rbd pool init volumes | ||
+ | # rbd pool init images | ||
+ | # rbd pool init backups | ||
+ | # rbd pool init vms | ||
+ | </ | ||
+ | |||
+ | ==== openstack用のkeyingを用意しておく ==== | ||
+ | |||
+ | < | ||
+ | # ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, | ||
+ | # ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, | ||
+ | # ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rbd_children, | ||
+ | # ceph auth get-or-create client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rbd_children, | ||
+ | </ | ||
+ | |||
+ | ==== OpenStack設定変更 ==== | ||
+ | |||
+ | このrbd-1ってのが、cephになります。 | ||
+ | |||
+ | < | ||
+ | # vi / | ||
+ | |||
+ | # Cinder | ||
+ | enable_cinder: | ||
+ | enable_cinder_backend_nfs: | ||
+ | skip_cinder_backend_check: | ||
+ | cinder_enabled_backends: | ||
+ | - name: rbd-1 | ||
+ | - name: linstor-drbd | ||
+ | - name: nfs-1 | ||
+ | |||
+ | # Cinder-Backup | ||
+ | enable_cinder_backup: | ||
+ | cinder_backup_driver: | ||
+ | cinder_backup_share: | ||
+ | |||
+ | ## ceph | ||
+ | glance_backend_ceph: | ||
+ | cinder_backend_ceph: | ||
+ | </ | ||
+ | |||
+ | ==== ceph.conf修正 ==== | ||
+ | ansibleを流すときに、ceph.confにタブがあると失敗するのでタブを削除 | ||
+ | |||
+ | sed -i ' | ||
+ | |||
+ | |||
+ | ==== ceph用のファイル用意 ==== | ||
+ | |||
+ | < | ||
+ | mkdir / | ||
+ | mkdir / | ||
+ | mkdir / | ||
+ | mkdir -p / | ||
+ | mkdir / | ||
+ | |||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | </ | ||
+ | |||
+ | ==== deploy ==== | ||
+ | kolla-ansible -i ./multinode deploy | ||
+ | |||
+ | {{tag> |