From db98049763d529193262f2b9a9eb66e9e33ba4cb Mon Sep 17 00:00:00 2001 From: lub Date: Sat, 7 Dec 2019 22:36:13 +0100 Subject: [PATCH] add client scripts --- bootstrap.sh | 9 +++++++++ node.sh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 139993f..a29a0f5 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -40,6 +40,15 @@ mkdir -p /ceph/mds/etc/ceph/ /ceph/mds/var/lib/ceph/bootstrap-mds cp -a /ceph/mon/etc/ceph/ceph.client.admin.keyring /ceph/mds/etc/ceph/ docker run -d --rm --net=ceph --hostname $(hostname) -v /ceph/mds/etc/ceph:/etc/ceph -v /ceph/mds/var/lib/ceph:/var/lib/ceph -e CEPHFS_CREATE=1 --name ceph_mds docker.io/ceph/daemon:latest-nautilus mds + +#client +mkdir -p /ceph/client/etc/ceph +docker exec ceph_mon ceph config generate-minimal-conf > /ceph/client/etc/ceph/ceph.conf +(docker exec ceph_mon ceph fs authorize cephfs client.$(hostname) / rw) > /ceph/client/etc/ceph/keyring +chmod 600 /ceph/client/etc/ceph/keyring +docker run -d --rm --net=ceph -v /cephfs:/cephfs:shared -v /ceph/client/etc/ceph:/etc/ceph --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined --name ceph_client --entrypoint ceph-fuse docker.io/ceph/daemon:latest-nautilus /cephfs -f --id $(hostname) + + #set cephfs autoscaling docker exec ceph_mon ceph mgr module enable pg_autoscaler docker exec ceph_mon ceph fs set cephfs max_mds 2 diff --git a/node.sh b/node.sh index 005680f..12787a8 100755 --- a/node.sh +++ b/node.sh @@ -46,5 +46,13 @@ cp -a /ceph/mon/etc/ceph/ceph.client.admin.keyring /ceph/mds/etc/ceph/ docker run -d --rm --net=ceph --hostname $(hostname) -v /ceph/mds/etc/ceph:/etc/ceph -v /ceph/mds/var/lib/ceph:/var/lib/ceph -e CEPHFS_CREATE=1 --name ceph_mds docker.io/ceph/daemon:latest-nautilus mds +#client +mkdir -p /ceph/client/etc/ceph +docker exec ceph_mon ceph config generate-minimal-conf > /ceph/client/etc/ceph/ceph.conf +(docker exec ceph_mon ceph fs authorize cephfs client.$(hostname) / rw) > /ceph/client/etc/ceph/keyring +chmod 600 /ceph/client/etc/ceph/keyring +docker run -d --rm --net=ceph -v /cephfs:/cephfs:shared -v /ceph/client/etc/ceph:/etc/ceph --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined --name ceph_client --entrypoint ceph-fuse docker.io/ceph/daemon:latest-nautilus /cephfs -f --id $(hostname) + + #status docker exec ceph_mon ceph status