{"id":273,"date":"2019-09-23T20:21:44","date_gmt":"2019-09-23T20:21:44","guid":{"rendered":"http:\/\/cephswift.com\/?page_id=273"},"modified":"2019-09-23T20:21:44","modified_gmt":"2019-09-23T20:21:44","slug":"how-to_setup_nfs_ganesha_ceph_docker_service","status":"publish","type":"page","link":"https:\/\/cephswift.com\/index.php\/how-to_setup_nfs_ganesha_ceph_docker_service\/","title":{"rendered":"How to_setup_nfs_ganesha_ceph_docker_service"},"content":{"rendered":"<p>Purpose of this setup:<br \/>\nThis setup is to test out how nfs-ganesha can be running as a docker process to connect a ceph cluster in docker, get cephfs then export to 3rd host as the nfs server.<\/p>\n<p>## add the nfs-ganesha host to existing ceph cluster&#8217;s host file<br \/>\n## on &#8220;10.8.100.27 ceph01&#8221;, do:<\/p>\n<p>[root@ip-10-8-100-27 ~]# cat \/etc\/hosts | grep ceph<br \/>\n10.8.100.27 ceph01<br \/>\n10.8.100.176 ceph02<br \/>\n10.8.100.139 ceph03<\/p>\n<p>[root@ip-10-8-100-27 ~]# echo &#8220;10.8.100.202 ganesha_01&#8221; &gt;&gt; \/etc\/hosts<\/p>\n<p>[root@ip-10-8-100-27 ~]# cat \/etc\/hosts | grep 10<br \/>\n10.8.100.27 ceph01<br \/>\n10.8.100.176 ceph02<br \/>\n10.8.100.139 ceph03<br \/>\n10.8.100.202 ganesha_01<\/p>\n<p>[root@ip-10-8-100-27 ~]# for i in {176,139,202}; do scp \/etc\/hosts 10.8.100.$i:\/etc\/hosts; done;<\/p>\n<p>## setup ssh key trust in between cluster and ganesha:<\/p>\n<p>[root@ip-10-8-100-27 ~]# ssh-copy-id ganesha_01<br \/>\n[root@ip-10-8-100-176 ~]# ssh-copy-id ganesha_01<br \/>\n[root@ip-10-8-100-139 ~]# ssh-copy-id ganesha_01<\/p>\n<p>[root@ip-10-8-100-202 ~]# ssh-keygen<br \/>\n[root@ip-10-8-100-202 ~]# for i in {27,176,139,202}; do ssh-copy-id 10.8.100.$i; done;<\/p>\n<p>## copy ceph config from ceph01 to ganesha node:<\/p>\n<p>[root@ip-10-8-100-27 ~]# ssh root@ganesha_01 mkdir -p \/var\/lib\/ceph<br \/>\n[root@ip-10-8-100-27 ~]# ssh root@ganesha_01 mkdir -p \/var\/ceph<br \/>\n[root@ip-10-8-100-27 ~]# scp -r \/etc\/ceph\/* root@ganesha_01:\/etc\/ceph\/<br \/>\nceph.conf 100% 220 224.9KB\/s 00:00<br \/>\nceph.client.admin.keyring 100% 159 195.1KB\/s 00:00<br \/>\nceph.mon.keyring 100% 688 528.8KB\/s 00:00<br \/>\n[root@ip-10-8-100-27 ~]# scp -r \/var\/lib\/ceph\/bootstrap* root@ganesha_01:\/var\/lib\/ceph\/<br \/>\nceph.keyring 100% 113 72.6KB\/s 00:00<br \/>\nceph.keyring 100% 113 61.7KB\/s 00:00<br \/>\nceph.keyring 100% 113 89.0KB\/s 00:00<br \/>\nceph.keyring 100% 113 91.9KB\/s 00:00<\/p>\n<p>## create ganesha docker run on ganesha node:<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker images<br \/>\nREPOSITORY TAG IMAGE ID CREATED SIZE<br \/>\nceph\/daemon HEAD-mimic-centos-7-aarch64 2d790517ca63 4 hours ago 823MB<br \/>\nceph\/daemon-base HEAD-mimic-centos-7-aarch64 560e662102f5 4 hours ago 693MB<br \/>\ncentos 7 7a51de8a65d5 3 months ago 238MB<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker run -d &#8211;net=host -v \/etc\/ceph:\/etc\/ceph -v \/var\/lib\/ceph\/:\/var\/lib\/ceph\/ 2d790517ca63 ganesha<br \/>\n9d83b14bbc3efbba3a97876f29cf0be691cfce5217807568eb84ca6ad9d6a1c8<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker run -d &#8211;net=host -v \/etc\/ceph:\/etc\/ceph -v \/var\/lib\/ceph\/:\/var\/lib\/ceph\/ 2d790517ca63 ceph-client<br \/>\n1decd18089e27cedc139c69450629b450df48b9b2b0abc7a67c53be4dd733609<br \/>\n[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]# docker container ls &#8211;all<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n1decd18089e2 2d790517ca63 &#8220;\/entrypoint.sh ceph\u2026&#8221; 4 seconds ago Exited (0) 3 seconds ago relaxed_mendeleev<br \/>\n9d83b14bbc3e 2d790517ca63 &#8220;\/entrypoint.sh gane\u2026&#8221; 4 minutes ago Exited (0) 4 minutes ago goofy_roentgen<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-27 ~]# docker run -d &#8211;net=host -v \/etc\/ceph:\/etc\/ceph -v \/var\/lib\/ceph\/:\/var\/lib\/ceph\/ ceph-13.2.6-daemon\/cento7 nfs<br \/>\n350d4b357061b984770230a0ae8ca9a9c36f2fb0ac097aeb5f7b3e9efa32350d<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n350d4b357061 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh nfs&#8221; 7 seconds ago Up 7 seconds zealous_mcnulty<br \/>\n60e13885c463 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh rgw&#8221; 2 weeks ago Up 2 weeks pensive_ramanujan<br \/>\nd0876c3f6699 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mds&#8221; 2 weeks ago Up 2 weeks wonderful_dijkstra<br \/>\n95230ffafa12 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mgr&#8221; 2 weeks ago Up 2 weeks stoic_bell<br \/>\n7c980d1930ef ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks frosty_blackwell<br \/>\n52d084554e82 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks boring_bhaskara<br \/>\n3869b330fc6d ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mon&#8221; 2 weeks ago Up 2 weeks elegant_bardeen<br \/>\n[root@ip-10-8-100-27 ~]#<\/p>\n<p>[root@ip-10-8-100-27 ~]# docker exec -it 350d4b357061 ceph -s<br \/>\ncluster:<br \/>\nid: a00f505c-c342-4208-a000-8e4444c53bd6<br \/>\nhealth: HEALTH_OK<\/p>\n<p>services:<br \/>\nmon: 3 daemons, quorum ip-10-8-100-27,ip-10-8-100-139,ip-10-8-100-176<br \/>\nmgr: ip-10-8-100-27(active)<br \/>\nmds: cephfs-1\/1\/1 up {0=ip-10-8-100-27=up:active}<br \/>\nosd: 6 osds: 6 up, 6 in<br \/>\nrgw: 1 daemon active<\/p>\n<p>data:<br \/>\npools: 7 pools, 156 pgs<br \/>\nobjects: 241 objects, 3.4 KiB<br \/>\nusage: 14 GiB used, 342 GiB \/ 356 GiB avail<br \/>\npgs: 156 active+clean<\/p>\n<p>[root@ip-10-8-100-27 ~]# docker run -d &#8211;net=host -v \/etc\/ceph:\/etc\/ceph -v \/var\/lib\/ceph\/:\/var\/lib\/ceph\/ ceph-13.2.6-daemon\/cento7 ganesha<br \/>\ne04a1bc3ebe88fb8d9b09a90faf93371a934ced0ee4ef419e7feb3dc37ef7ff4<\/p>\n<p>[root@ip-10-8-100-27 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n350d4b357061 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh nfs&#8221; 6 minutes ago Up 6 minutes zealous_mcnulty<br \/>\n60e13885c463 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh rgw&#8221; 2 weeks ago Up 2 weeks pensive_ramanujan<br \/>\nd0876c3f6699 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mds&#8221; 2 weeks ago Up 2 weeks wonderful_dijkstra<br \/>\n95230ffafa12 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mgr&#8221; 2 weeks ago Up 2 weeks stoic_bell<br \/>\n7c980d1930ef ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks frosty_blackwell<br \/>\n52d084554e82 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks boring_bhaskara<br \/>\n3869b330fc6d ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mon&#8221; 2 weeks ago Up 2 weeks elegant_bardeen<\/p>\n<p>[root@ip-10-8-100-27 ~]# docker container ls &#8211;all<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\ne04a1bc3ebe8 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh gane\u2026&#8221; 2 minutes ago Exited (0) 2 minutes ago infallible_shtern<br \/>\n350d4b357061 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh nfs&#8221; 7 minutes ago Up 7 minutes zealous_mcnulty<br \/>\n60e13885c463 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh rgw&#8221; 2 weeks ago Up 2 weeks pensive_ramanujan<br \/>\nd0876c3f6699 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mds&#8221; 2 weeks ago Up 2 weeks wonderful_dijkstra<br \/>\n95230ffafa12 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mgr&#8221; 2 weeks ago Up 2 weeks stoic_bell<br \/>\n7c980d1930ef ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks frosty_blackwell<br \/>\n52d084554e82 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks boring_bhaskara<br \/>\n3869b330fc6d ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mon&#8221; 2 weeks ago Up 2 weeks elegant_bardeen<br \/>\n[root@ip-10-8-100-27 ~]#<\/p>\n<p>### we can see that the ganesha docker cannot be created sucessfully for some reason, the status is &#8220;Exited&#8221;, need to find out !!!<br \/>\n### however, the same image can be used to creat a mon, which works well:<br \/>\n#<br \/>\n[root@ip-10-8-100-202 ~]# docker images<br \/>\nREPOSITORY TAG IMAGE ID CREATED SIZE<br \/>\nceph\/daemon HEAD-mimic-centos-7-aarch64 2d790517ca63 5 hours ago 823MB<br \/>\nceph\/daemon-base HEAD-mimic-centos-7-aarch64 560e662102f5 5 hours ago 693MB<br \/>\ncentos 7 7a51de8a65d5 3 months ago 238MB<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker run -d &#8211;net=host -v \/etc\/ceph:\/etc\/ceph -v \/var\/lib\/ceph\/:\/var\/lib\/ceph\/ -e MON_IP=10.8.100.202 -e CEPH_PUBLIC_NETWORK=10.1.100.0\/24 2d790517ca63 mon<br \/>\n510ed14031ae62cc7d242ec8b4b140272012645414acde4b581327c4b8b1af44<br \/>\n[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n510ed14031ae 2d790517ca63 &#8220;\/entrypoint.sh mon&#8221; 6 seconds ago Up 5 seconds adoring_albattani<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker exec -it 510ed14031ae ceph -s<br \/>\ncluster:<br \/>\nid: a00f505c-c342-4208-a000-8e4444c53bd6<br \/>\nhealth: HEALTH_OK<\/p>\n<p>services:<br \/>\nmon: 4 daemons, quorum ip-10-8-100-27,ip-10-8-100-139,ip-10-8-100-176,ip-10-8-100-202<br \/>\nmgr: ip-10-8-100-27(active)<br \/>\nmds: cephfs-1\/1\/1 up {0=ip-10-8-100-27=up:active}<br \/>\nosd: 6 osds: 6 up, 6 in<br \/>\nrgw: 1 daemon active<\/p>\n<p>data:<br \/>\npools: 7 pools, 156 pgs<br \/>\nobjects: 241 objects, 3.4 KiB<br \/>\nusage: 14 GiB used, 342 GiB \/ 356 GiB avail<br \/>\npgs: 156 active+clean<\/p>\n<p>[root@ip-10-8-100-202 ~]#<\/p>\n<p>## verify pkgs installed:<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n510ed14031ae 2d790517ca63 &#8220;\/entrypoint.sh mon&#8221; 8 minutes ago Up 8 minutes adoring_albattani<br \/>\n[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]# docker exec -it 510ed14031ae yum list installed | grep ganesha<br \/>\n[root@ip-10-8-100-202 ~]# docker exec -it 510ed14031ae rpm -qa | grep ganesha<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-27 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n350d4b357061 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh nfs&#8221; 36 minutes ago Up 36 minutes zealous_mcnulty<br \/>\n60e13885c463 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh rgw&#8221; 2 weeks ago Up 2 weeks pensive_ramanujan<br \/>\nd0876c3f6699 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mds&#8221; 2 weeks ago Up 2 weeks wonderful_dijkstra<br \/>\n95230ffafa12 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mgr&#8221; 2 weeks ago Up 2 weeks stoic_bell<br \/>\n7c980d1930ef ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks frosty_blackwell<br \/>\n52d084554e82 ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh osd_\u2026&#8221; 2 weeks ago Up 2 weeks boring_bhaskara<br \/>\n3869b330fc6d ceph-13.2.6-daemon\/cento7 &#8220;\/entrypoint.sh mon&#8221; 2 weeks ago Up 2 weeks elegant_bardeen<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]# docker exec -it 3869b330fc6d yum list installed | grep ganesha<br \/>\nnfs-ganesha.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-ceph.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-debuginfo.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-gpfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-lttng.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mem.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mount-9P.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-nullfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-proxy.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rados-grace.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rgw.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-vfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-xfs.aarch64 2.7.1-0.1.el7 installed<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]# docker exec -it 350d4b357061 yum list installed | grep ganesha<br \/>\nnfs-ganesha.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-ceph.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-debuginfo.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-gpfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-lttng.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mem.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mount-9P.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-nullfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-proxy.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rados-grace.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rgw.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-vfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-xfs.aarch64 2.7.1-0.1.el7 installed<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]# docker exec -it 350d4b357061 rpm -qa | grep ganesha<br \/>\nnfs-ganesha-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-gpfs-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-mem-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-proxy-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-rgw-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-xfs-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-debuginfo-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-ceph-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-lttng-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-nullfs-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-rados-grace-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-vfs-2.7.1-0.1.el7.aarch64<br \/>\nnfs-ganesha-mount-9P-2.7.1-0.1.el7.aarch64<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n#########################################################################################<br \/>\n## cook 5 files below to make &#8220;ganesha\/aarch64-cento7&#8221; docker image:<br \/>\n#<br \/>\n[root@ip-10-8-100-202 ~]# vi kubernetes.repo<br \/>\n[root@ip-10-8-100-202 ~]# vi ganesha.repo<br \/>\n[root@ip-10-8-100-202 ~]# vi ceph.repo<br \/>\n[root@ip-10-8-100-202 ~]# vi dockerfile<br \/>\n[root@ip-10-8-100-202 ~]# vi build_ganesha_aarch64_cento7_docker_image.sh<\/p>\n<p>[root@ip-10-8-100-202 ~]# ls -ltr<br \/>\ntotal 20<br \/>\n-rw-r&#8211;r&#8211; 1 root root 264 Jul 15 21:28 kubernetes.repo<br \/>\n-rw-r&#8211;r&#8211; 1 root root 79 Jul 15 21:28 ganesha.repo<br \/>\n-rw-r&#8211;r&#8211; 1 root root 537 Jul 15 21:28 ceph.repo<br \/>\n-rw-r&#8211;r&#8211; 1 root root 2400 Jul 15 23:44 dockerfile<br \/>\n-rw-r&#8211;r&#8211; 1 root root 41 Jul 15 23:56 build_ganesha_aarch64_cento7_docker_image.sh<\/p>\n<p>[root@ip-10-8-100-202 ~]# cat ganesha.repo<br \/>\n[ganesha]<br \/>\nname=ganesha<br \/>\nbaseurl=http:\/\/10.8.100.27\/ganesha<br \/>\ngpgcheck=0<br \/>\nenabled=1<br \/>\n[root@ip-10-8-100-202 ~]# cat kubernetes.repo<br \/>\n[kubernetes]<br \/>\nname=Kubernetes<br \/>\nbaseurl=https:\/\/packages.cloud.google.com\/yum\/repos\/kubernetes-el7-aarch64<br \/>\nenabled=1<br \/>\ngpgcheck=1<br \/>\nrepo_gpgcheck=0<br \/>\ngpgkey=https:\/\/packages.cloud.google.com\/yum\/doc\/yum-key.gpg https:\/\/packages.cloud.google.com\/yum\/doc\/rpm-package-key.gpg<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-202 ~]# cat ceph.repo<br \/>\n[ceph]<br \/>\nname=Ceph packages for \\$basearch<br \/>\nbaseurl=https:\/\/download.ceph.com\/rpm-mimic\/el7\/\\$basearch<br \/>\nenabled=1<br \/>\npriority=2<br \/>\ngpgcheck=1<br \/>\ngpgkey=https:\/\/download.ceph.com\/keys\/release.asc<\/p>\n<p>[ceph-noarch]<br \/>\nname=Ceph noarch packages<br \/>\nbaseurl=https:\/\/download.ceph.com\/rpm-mimic\/el7\/noarch<br \/>\nenabled=1<br \/>\npriority=2<br \/>\ngpgcheck=1<br \/>\ngpgkey=https:\/\/download.ceph.com\/keys\/release.asc<\/p>\n<p>[ceph-source]<br \/>\nname=Ceph source packages<br \/>\nbaseurl=https:\/\/download.ceph.com\/rpm-mimic\/el7\/SRPMS<br \/>\nenabled=0<br \/>\npriority=2<br \/>\ngpgcheck=1<br \/>\ngpgkey=https:\/\/download.ceph.com\/keys\/release.asc<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-202 ~]# cat build_ganesha_aarch64_cento7_docker_image.sh<br \/>\ndocker build -t ganesha\/aarch64-cento7 .<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-202 ~]# cat dockerfile<br \/>\n# CEPH DAEMON IMAGE<br \/>\n# CEPH VERSION: Mimic<br \/>\n# CEPH VERSION DETAIL: 13.2.6<\/p>\n<p>FROM centos:7<br \/>\nMAINTAINER Benjamin Lu &#8220;Benjamin.lu@gokeuslabcom&#8221;<\/p>\n<p>RUN yum update -y<\/p>\n<p>ENV CEPH_VERSION 13.2.6<br \/>\nENV CONFD_VERSION 0.10.0<br \/>\nENV KUBECTL_VERSION v1.6.0<\/p>\n<p>CMD [&#8220;\/usr\/sbin\/init&#8221;]<\/p>\n<p># install prerequisites<br \/>\n##############################################<br \/>\n# setup ceph.repo, kubernetes.repo<br \/>\nADD ceph.repo \/etc\/yum.repos.d\/<br \/>\nADD kubernetes.repo \/etc\/yum.repos.d\/<br \/>\nADD ganesha.repo \/etc\/yum.repos.d\/<br \/>\n##############################################<br \/>\n# install ceph, ganesha and repends<br \/>\nRUN yum -y update &amp;&amp; yum install -y wget which unzip rpm uuid-runtime python-setuptools udev dmsetup localedef &amp;&amp; \\<br \/>\nyum install -y https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm &amp;&amp; \\<br \/>\nyum install -y yum-utils device-mapper-persistent-data lvm2 &amp;&amp; \\<br \/>\nyum install -y libtirpc nfs-utils rpcbind libwbclient lttng-tools &amp;&amp; \\<br \/>\nrpm &#8211;import &#8216;https:\/\/download.ceph.com\/keys\/release.asc&#8217; &amp;&amp; \\<br \/>\nyum clean all &amp;&amp; \\<br \/>\nrm -rf \/var\/cache\/yum &amp;&amp; \\<br \/>\nyum install -y ceph-common ceph-base libcephfs libcephfs-devel libcephfs2 python-cephfs ceph-fuse nfs-ganesha &amp;&amp; \\<br \/>\nwhich ceph &amp;&amp; \\<br \/>\nceph &#8211;version &amp;&amp; \\<br \/>\ncurl -L http:\/\/10.8.100.27\/ganesha\/rpm-V2.7-stable\/mimic\/aarch64\/ganesha-rpms-list &gt; ganesha-rpms-list &amp;&amp; \\<br \/>\nbash -c &#8216; \\<br \/>\nif [ -n &#8220;ganesha-rpms-list&#8221; ]; then \\<br \/>\nfor i in `cat ganesha-rpms-list`; do rpm -Uvh http:\/\/10.8.100.27\/ganesha\/rpm-V2.7-stable\/mimic\/aarch64\/$i; done; \\<br \/>\nfi &#8216; &amp;&amp; \\<br \/>\nyum list installed | grep ganesha &amp;&amp; \\<br \/>\nrpm -qa | grep ganesha &amp;&amp; \\<br \/>\n#######################################################<br \/>\n# Install kubenetes<br \/>\nyum makecache fast &amp;&amp; \\<br \/>\nyum install -y kubelet kubeadm kubectl &amp;&amp; \\<br \/>\nwhich kubelet kubeadm kubectl &amp;&amp; \\<br \/>\nchmod +x \/usr\/bin\/kubectl &amp;&amp; \\<\/p>\n<p># set rpcbind, portmap, dbus<br \/>\nrm -rf \/var\/lib\/apt\/lists\/* \/tmp\/* \/var\/tmp\/* &amp;&amp; \\<br \/>\nmkdir -p \/run\/rpcbind \/export \/var\/run\/dbus &amp;&amp; \\<br \/>\ntouch \/run\/rpcbind\/rpcbind.xdr \/run\/rpcbind\/portmap.xdr &amp;&amp; \\<br \/>\nchmod 755 \/run\/rpcbind\/* &amp;&amp; \\<br \/>\n#chown messagebus:messagebus \/var\/run\/dbus &amp;&amp; \\<\/p>\n<p># set locale<br \/>\nyum reinstall -y glibc-common &amp;&amp; \\<br \/>\nlocaledef -i en_US -f UTF-8 en_US.UTF-8<\/p>\n<p># Add startup script<br \/>\nCOPY start.sh \/<\/p>\n<p># Add volumes for Ceph config and data<br \/>\nVOLUME [&#8220;\/etc\/ceph&#8221;,&#8221;\/var\/lib\/ceph&#8221;, &#8220;\/etc\/ganesha&#8221;]<\/p>\n<p># NFS ports and portmapper<br \/>\nEXPOSE 2049 38465-38467 662 111\/udp 111<\/p>\n<p># Start Ganesha NFS daemon by default<br \/>\nCMD [&#8220;\/start.sh&#8221;]<\/p>\n<p>LABEL version=&#8221;1.0&#8243;<\/p>\n<p>[root@ip-10-8-100-202 ~]#<\/p>\n<p>## making the nfs-ganesha docker images now:<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker build -t ganesha\/aarch64-cento7 .<br \/>\n&#8230;&#8230;&#8230;.<br \/>\n&#8230;&#8230;&#8230;.<br \/>\nInstalled:<br \/>\nglibc-common.aarch64 0:2.17-260.el7_6.6<br \/>\nComplete!<br \/>\nRemoving intermediate container 8dd283e800d5<br \/>\n&#8212;&gt; 7f7e24e1f168<br \/>\nStep 12\/16 : COPY start.sh \/<br \/>\n&#8212;&gt; 96250be9b1d4<br \/>\nStep 13\/16 : VOLUME [&#8220;\/etc\/ceph&#8221;,&#8221;\/var\/lib\/ceph&#8221;, &#8220;\/etc\/ganesha&#8221;]<br \/>\n&#8212;&gt; Running in 7de4edbe18b1<br \/>\nRemoving intermediate container 7de4edbe18b1<br \/>\n&#8212;&gt; f4f1205a245b<br \/>\nStep 14\/16 : EXPOSE 2049 38465-38467 662 111\/udp 111<br \/>\n&#8212;&gt; Running in bd568d76beda<br \/>\nRemoving intermediate container bd568d76beda<br \/>\n&#8212;&gt; f5b8a0c85f9c<br \/>\nStep 15\/16 : CMD [&#8220;\/start.sh&#8221;]<br \/>\n&#8212;&gt; Running in 0e349c672aa8<br \/>\nRemoving intermediate container 0e349c672aa8<br \/>\n&#8212;&gt; f798624743b0<br \/>\nStep 16\/16 : LABEL version=&#8221;1.0&#8243;<br \/>\n&#8212;&gt; Running in 81345ed03c02<br \/>\nRemoving intermediate container 81345ed03c02<br \/>\n&#8212;&gt; 716a66a9fc7e<br \/>\nSuccessfully built 716a66a9fc7e<br \/>\nSuccessfully tagged ganesha\/aarch64-cento7:latest<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker images<br \/>\nREPOSITORY TAG IMAGE ID CREATED SIZE<br \/>\nganesha\/aarch64-cento7 latest 716a66a9fc7e 28 seconds ago 1.12GB<br \/>\ncentos 7 7a51de8a65d5 4 months ago 238MB<\/p>\n<p>[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]# docker run -it ganesha\/aarch64-cento7 \/bin\/bash<br \/>\n[root@7d53be711b2a \/]#<br \/>\n[root@7d53be711b2a \/]# which ceph<br \/>\n\/usr\/bin\/ceph<br \/>\n[root@7d53be711b2a \/]#<br \/>\n[root@7d53be711b2a \/]#<br \/>\n[root@7d53be711b2a \/]# ceph &#8211;version<br \/>\nceph version 13.2.6 (7b695f835b03642f85998b2ae7b6dd093d9fbce4) mimic (stable)<br \/>\n[root@7d53be711b2a \/]#<br \/>\n[root@7d53be711b2a \/]#<br \/>\n[root@7d53be711b2a \/]# yum list installed | grep nfs<br \/>\nlibnfsidmap.aarch64 0.25-19.el7 @base<br \/>\nnfs-ganesha.aarch64 2.7.1-0.1.el7 @ganesha<br \/>\nnfs-ganesha-ceph.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-debuginfo.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-gpfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-lttng.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mem.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mount-9P.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-nullfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-proxy.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rados-grace.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rgw.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-vfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-xfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-utils.aarch64 1:1.3.0-0.61.el7 @base<br \/>\n[root@7d53be711b2a \/]#<\/p>\n<p>#####################################################################################################<br \/>\n#This section make cephfs export through libcephfs2<br \/>\n#test export ceph ganesha nfs to 3rd server:<br \/>\n#<br \/>\n[root@ip-10-8-100-27 ceph]# vi \/etc\/ceph\/ceph.conf<br \/>\n[root@ip-10-8-100-27 ceph]# cat \/etc\/ceph\/ceph.conf<br \/>\n[global]<br \/>\nfsid = a00f505c-c342-4208-a000-8e4444c53bd6<br \/>\nmon initial members = ip-10-8-100-27,ip-10-8-100-176,ip-10-8-100-139<br \/>\nmon host = 10.8.100.27,10.8.100.176,10.8.100.139<br \/>\npublic network = 10.8.100.0\/24<br \/>\ncluster network = 10.8.100.0\/24<br \/>\nosd journal size = 100<br \/>\nlog file = \/dev\/null<br \/>\n[client]<br \/>\nmon_host = 10.8.100.27:6789,10.8.100.176:6789,10.8.100.139:6789<br \/>\n[root@ip-10-8-100-27 ceph]#<\/p>\n<p>[root@ip-10-8-100-27 ceph]# for i in {176,139,202}; do scp \/etc\/ceph\/ceph.conf 10.8.100.$i:\/etc\/ceph\/; done;<\/p>\n<p>[root@ip-10-8-100-202 ceph]# vi \/etc\/ganesha\/ganesha.conf<br \/>\n[root@ip-10-8-100-202 ceph]# cat \/etc\/ganesha\/ganesha.conf<br \/>\nEXPORT<br \/>\n{<br \/>\nExport_Id = 2;<br \/>\nPath = &#8220;\/&#8221;;<br \/>\nPseudo = &#8220;\/&#8221;;<br \/>\nProtocols = 3,4;<br \/>\nTransport_Protocols = UDP,TCP;<br \/>\nAccess_Type = RW;<br \/>\nSquash = root_squash;<br \/>\n## Allowed security types for this export<br \/>\nSectype = sys,krb5,krb5i,krb5p;<\/p>\n<p>## Exporting FSAL<br \/>\nFSAL {<br \/>\nName = VFS;<br \/>\n}<br \/>\nFSAL {<br \/>\nName = CEPH;<br \/>\n}<br \/>\n}<\/p>\n<p># Config RGW for ceph<br \/>\nRGW<br \/>\n{<br \/>\nceph_conf = &#8220;\/etc\/ceph\/ceph.conf&#8221;;<br \/>\nname = &#8220;name&#8221;;<br \/>\ncluster = &#8220;ceph&#8221;;<br \/>\n}<\/p>\n<p># Config block for FSAL_CEPH<br \/>\nCEPH<br \/>\n{<br \/>\n# Path to a ceph.conf file for this cluster.<br \/>\nceph_conf = &#8220;\/etc\/ceph\/ceph.conf&#8221;;<\/p>\n<p># User file-creation mask. These bits will be masked off from the unix<br \/>\n# permissions on newly-created inodes.<br \/>\numask = 0;<br \/>\n}<\/p>\n<p># Config NFSV4<br \/>\nNFSV4<br \/>\n{<br \/>\nAllow_Numeric_Owners = true;<br \/>\nOnly_Numeric_Owners = true;<br \/>\n}<br \/>\n[root@ip-10-8-100-202 ceph]#<\/p>\n<p>495 vi setup_firewall.sh<br \/>\n496 cat setup_firewall.sh<br \/>\n497 chmod 755 setup_firewall.sh<br \/>\n498 .\/setup_firewall.sh<\/p>\n<p>509 ceph-authtool -p \/etc\/ceph\/ceph.client.admin.keyring &gt; ceph.key<br \/>\n511 chmod 600 ceph.key<br \/>\n516 sudo mount -t ceph 10.8.100.27:6789:\/ \/mnt\/cephfs-nfs -o name=admin,secretfile=ceph.key<br \/>\n518 umount \/mnt\/cephfs-nfs<br \/>\n519 df -h<br \/>\n520 sudo mount -t ceph 10.8.100.27:6789:\/ \/mnt\/cephfs-nfs -o name=admin,secretfile=ceph.key<br \/>\n526 cd \/mnt\/cephfs-nfs<br \/>\n527 ls -ltr<br \/>\n528 mkdir test_ganesha_wr<br \/>\n593 netstat -an | grep 6789<\/p>\n<p>## test export the ganesha export from ceph to 3rd server at 10.8.100.32:<br \/>\n#<br \/>\n[root@ip-10-8-100-32 ~]# mount -t nfs -o nfsvers=4.1,proto=tcp 10.8.100.202:\/ \/root\/from_nfs_ganesha_export_dir<br \/>\n[root@ip-10-8-100-32 ~]# df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\ndevtmpfs 1.9G 0 1.9G 0% \/dev<br \/>\ntmpfs 1.9G 0 1.9G 0% \/dev\/shm<br \/>\ntmpfs 1.9G 428K 1.9G 1% \/run<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/nvme0n1p1 60G 2.9G 58G 5% \/<br \/>\n\/dev\/nvme0n1p128 10M 3.7M 6.3M 38% \/boot\/efi<br \/>\ntmpfs 380M 0 380M 0% \/run\/user\/1001<br \/>\n10.8.100.202:\/ 105G 0 105G 0% \/root\/from_nfs_ganesha_export_dir<br \/>\n[root@ip-10-8-100-32 ~]# cd \/root\/from_nfs_ganesha_export_dir<br \/>\n[root@ip-10-8-100-32 from_nfs_ganesha_export_dir]# ls -ltr<br \/>\ntotal 1<br \/>\ndrwxr-xr-x 2 root root 0 Jul 17 22:24 test_ganesha_wr<br \/>\n[root@ip-10-8-100-32 from_nfs_ganesha_export_dir]#<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker run &#8211;privileged ganesha\/aarch64-cento7 &amp;<\/p>\n<p>[root@ip-10-8-100-27 ~]# scp -r \/var\/lib\/ceph\/bootstrap* root@ganesha_02:\/var\/lib\/ceph<br \/>\nceph.keyring 100% 113 36.8KB\/s 00:00<br \/>\nceph.keyring 100% 113 90.6KB\/s 00:00<br \/>\nceph.keyring 100% 113 37.5KB\/s 00:00<br \/>\nceph.keyring 100% 113 82.1KB\/s 00:00<br \/>\n[root@ip-10-8-100-27 ~]#<br \/>\n[root@ip-10-8-100-27 ~]# scp -r \/etc\/ceph root@ganesha_02:\/etc\/ceph<br \/>\nceph.client.admin.keyring 100% 159 159.7KB\/s 00:00<br \/>\nceph.mon.keyring 100% 688 841.9KB\/s 00:00<br \/>\nceph.conf 100% 351 413.4KB\/s 00:00<br \/>\nceph.conf.orig.BKUP<\/p>\n<p>[root@ip-10-8-100-32 ~]# ls -l \/etc\/ceph<br \/>\ntotal 20<br \/>\n-rw&#8212;&#8212;- 1 root root 159 Jul 19 22:32 ceph.client.admin.keyring<br \/>\n-rw-r&#8211;r&#8211; 1 root root 351 Jul 19 22:32 ceph.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root root 220 Jul 19 22:32 ceph.conf.orig.BKUP<br \/>\n-rw-r&#8211;r&#8211; 1 root root 41 Jul 19 23:22 ceph.key<br \/>\n-rw&#8212;&#8212;- 1 root root 688 Jul 19 22:32 ceph.mon.keyring<br \/>\n[root@ip-10-8-100-32 ~]#<br \/>\n[root@ip-10-8-100-32 ~]# ls -l \/var\/lib\/ceph\/bootstrap*<br \/>\n\/var\/lib\/ceph\/bootstrap-mds:<br \/>\ntotal 4<br \/>\n-rw&#8212;&#8212;- 1 root root 113 Jul 19 22:32 ceph.keyring<\/p>\n<p>\/var\/lib\/ceph\/bootstrap-osd:<br \/>\ntotal 4<br \/>\n-rw&#8212;&#8212;- 1 root root 113 Jul 19 22:32 ceph.keyring<\/p>\n<p>\/var\/lib\/ceph\/bootstrap-rbd:<br \/>\ntotal 4<br \/>\n-rw&#8212;&#8212;- 1 root root 113 Jul 19 22:32 ceph.keyring<\/p>\n<p>\/var\/lib\/ceph\/bootstrap-rgw:<br \/>\ntotal 4<br \/>\n-rw&#8212;&#8212;- 1 root root 113 Jul 19 22:32 ceph.keyring<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker cp \/etc\/ceph\/ceph.client.admin.keyring 4592ec428182:\/etc\/ceph\/<br \/>\n[root@ip-10-8-100-32 ~]# docker exec 4592ec428182 ceph-authtool -p \/etc\/ceph\/ceph.client.admin.keyring | tee \/etc\/ceph\/ceph.key ## this line does not work<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker exec 4592ec428182 ceph -s<br \/>\ncluster:<br \/>\nid: a00f505c-c342-4208-a000-8e4444c53bd6<br \/>\nhealth: HEALTH_WARN<br \/>\n1\/4 mons down, quorum ip-10-8-100-27,ip-10-8-100-139,ip-10-8-100-176<\/p>\n<p>services:<br \/>\nmon: 4 daemons, quorum ip-10-8-100-27,ip-10-8-100-139,ip-10-8-100-176, out of quorum: ip-10-8-100-202<br \/>\nmgr: ip-10-8-100-27(active)<br \/>\nmds: cephfs-1\/1\/1 up {0=ip-10-8-100-27=up:active}<br \/>\nosd: 6 osds: 6 up, 6 in<br \/>\nrgw: 1 daemon active<\/p>\n<p>data:<br \/>\npools: 7 pools, 156 pgs<br \/>\nobjects: 241 objects, 8.6 KiB<br \/>\nusage: 14 GiB used, 342 GiB \/ 356 GiB avail<br \/>\npgs: 156 active+clean<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker exec 4592ec428182 mkdir \/mnt\/cephfs<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker exec 4592ec428182 ls -l \/mnt\/cephfs<br \/>\ntotal 0<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker exec 4592ec428182 yum list installed | grep nfs<br \/>\nlibnfsidmap.aarch64 0.25-19.el7 @base<br \/>\nnfs-ganesha.aarch64 2.7.1-0.1.el7 @ganesha<br \/>\nnfs-ganesha-ceph.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-debuginfo.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-gpfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-lttng.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mem.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-mount-9P.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-nullfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-proxy.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rados-grace.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-rgw.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-vfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-ganesha-xfs.aarch64 2.7.1-0.1.el7 installed<br \/>\nnfs-utils.aarch64 1:1.3.0-0.61.el7 @base<br \/>\n[root@ip-10-8-100-32 ~]#<\/p>\n<p>https:\/\/github.com\/mitcdh\/docker-nfs-ganesha<\/p>\n<p>## test write from docker on ceph client -ganesha1 ( 10.8.100.202)<br \/>\n# create docker name it as &#8220;ganasha&#8221; with mount point \/export inside docker to use cephfs-nfs from ceph cluster:<br \/>\n#<br \/>\n[root@ip-10-8-100-202 ~]# docker run -d &#8211;name ganesha -v \/mnt\/cephfs-nfs:\/export ganesha\/aarch64-cento7<br \/>\n69a29172aa0264a93cfa62f3c3396388752c6e55c13c0027aa5ecc100b8c6d9d<br \/>\n[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n69a29172aa02 ganesha\/aarch64-cento7 &#8220;\/start.sh&#8221; 7 seconds ago Up 6 seconds 2049\/tcp, 38465-38467\/tcp ganesha<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker exec 69a29172aa02 df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\noverlay 60G 3.7G 57G 7% \/<br \/>\ntmpfs 64M 0 64M 0% \/dev<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/fs\/cgroup<br \/>\n10.8.100.27:\/ 104G 0 104G 0% \/export<br \/>\n\/dev\/nvme0n1p1 60G 3.7G 57G 7% \/etc\/ceph<br \/>\nshm 64M 8.0K 64M 1% \/dev\/shm<br \/>\ntmpfs 1.9G 0 1.9G 0% \/proc\/acpi<br \/>\ntmpfs 1.9G 0 1.9G 0% \/proc\/scsi<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/firmware<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>## test tounch a file inside docker on the cephfs mount \/export:<br \/>\n#<br \/>\n[root@ip-10-8-100-202 ~]# docker exec 69a29172aa02 touch \/export\/test_ganesha_wr\/testfile<br \/>\n[root@ip-10-8-100-202 ~]# docker exec 69a29172aa02 ls -l \/export\/test_ganesha_wr<br \/>\ntotal 0<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 00:06 testfile<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker exec 69a29172aa02 touch \/export\/test_ganesha_wr\/testfile2<br \/>\n[root@ip-10-8-100-202 ~]# docker exec 69a29172aa02 touch \/export\/test_ganesha_wr\/testfile3<\/p>\n<p>[root@ip-10-8-100-202 ~]# docker exec 69a29172aa02 ls -l \/export\/test_ganesha_wr<br \/>\ntotal 0<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 00:06 testfile<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:22 testfile2<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:25 testfile3<\/p>\n<p>## check 3 files in local dir if 3 files are visiable<\/p>\n<p>[root@ip-10-8-100-202 ~]# df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\ndevtmpfs 1.9G 0 1.9G 0% \/dev<br \/>\ntmpfs 1.9G 0 1.9G 0% \/dev\/shm<br \/>\ntmpfs 1.9G 556K 1.9G 1% \/run<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/nvme0n1p1 60G 3.7G 57G 7% \/<br \/>\n\/dev\/nvme0n1p128 10M 3.7M 6.3M 38% \/boot\/efi<br \/>\n10.8.100.27:\/ 104G 0 104G 0% \/mnt\/cephfs-nfs<br \/>\noverlay 60G 3.7G 57G 7% \/var\/lib\/docker\/overlay2\/6671136a87233f9370b1ef13d3ed97cdef6ae0e433ee95c514d52cdddaeb4aab\/merged<br \/>\nshm 64M 8.0K 64M 1% \/var\/lib\/docker\/containers\/69a29172aa0264a93cfa62f3c3396388752c6e55c13c0027aa5ecc100b8c6d9d\/mounts\/shm<br \/>\ntmpfs 380M 0 380M 0% \/run\/user\/0<br \/>\n[root@ip-10-8-100-202 ~]#<br \/>\n[root@ip-10-8-100-202 ~]# ls -l \/mnt\/cephfs-nfs<br \/>\ntotal 0<br \/>\ndrwxr-xr-x 1 root root 3 Jul 23 19:25 test_ganesha_wr<br \/>\n[root@ip-10-8-100-202 ~]# ls -l \/mnt\/cephfs-nfs\/test_ganesha_wr\/<br \/>\ntotal 0<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 00:06 testfile<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:22 testfile2<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:25 testfile3<br \/>\n[root@ip-10-8-100-202 ~]#<\/p>\n<p>## Let&#8217;s verify 3 files on docker that ruuning on other ceph client node: ganesha2 (10.8.100.32):<br \/>\n# create a docker fist:<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker run -d &#8211;name ganesha -v \/root\/from_nfs_ganesha_export_dir:\/export ganesha\/aarch64-cento7<br \/>\nfde05b4a10d687539530c483f24c658f4e18ae373b1c77b095322be1eccd5d3f<br \/>\n[root@ip-10-8-100-32 ~]#<br \/>\n[root@ip-10-8-100-32 ~]# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\nfde05b4a10d6 ganesha\/aarch64-cento7 &#8220;\/start.sh&#8221; 6 seconds ago Up 5 seconds 2049\/tcp, 38465-38467\/tcp ganesha<\/p>\n<p>[root@ip-10-8-100-32 ~]#<br \/>\n[root@ip-10-8-100-32 ~]# docker exec fde05b4a10d6 df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\noverlay 60G 4.0G 57G 7% \/<br \/>\ntmpfs 64M 0 64M 0% \/dev<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/fs\/cgroup<br \/>\n10.8.100.202:\/ 104G 0 104G 0% \/export<br \/>\n\/dev\/nvme0n1p1 60G 4.0G 57G 7% \/etc\/ceph<br \/>\nshm 64M 8.0K 64M 1% \/dev\/shm<br \/>\ntmpfs 1.9G 0 1.9G 0% \/proc\/acpi<br \/>\ntmpfs 1.9G 0 1.9G 0% \/proc\/scsi<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/firmware<br \/>\n[root@ip-10-8-100-32 ~]#<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker exec fde05b4a10d6 ls -l \/export\/test_ganesha_wr<br \/>\ntotal 0<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 00:06 testfile<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:22 testfile2<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:25 testfile3<br \/>\n[root@ip-10-8-100-32 ~]#<\/p>\n<p>## however, test found that 3 files is not permiited to write contains from docker runing on ceph client node: ganesha2 (10.8.100.32):<br \/>\n#<br \/>\n[root@ip-10-8-100-32 ~]# docker exec fde05b4a10d6 echo &#8216;This is a test write on server 32 docker, it will show up in server 202 docker&#8217; &gt; \/export\/test_ganesha_wr\/testfile<br \/>\n-bash: \/export\/test_ganesha_wr\/testfile: No such file or directory<br \/>\n[root@ip-10-8-100-32 ~]# docker exec fde05b4a10d6 echo &#8216;This is a test write on server 32 docker, it will show up in server 202 docker&#8217; | tee \/export\/test_ganesha_wr\/testfile<br \/>\ntee: \/export\/test_ganesha_wr\/testfile: No such file or directory<br \/>\nThis is a test write on server 32 docker, it will show up in server 202 docker<br \/>\n[root@ip-10-8-100-32 ~]# docker exec fde05b4a10d6 cat \/export\/test_ganesha_wr\/testfile<br \/>\n[root@ip-10-8-100-32 ~]#<\/p>\n<p>## let&#8217;s go inside the docker to try write again:<\/p>\n<p>[root@ip-10-8-100-32 ~]# docker exec -it fde05b4a10d6 \/bin\/bash<br \/>\n[root@fde05b4a10d6 \/]#<\/p>\n<p>[root@fde05b4a10d6 \/]# df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\noverlay 60G 4.0G 57G 7% \/<br \/>\ntmpfs 64M 0 64M 0% \/dev<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/fs\/cgroup<br \/>\n10.8.100.202:\/ 104G 0 104G 0% \/export<br \/>\n\/dev\/nvme0n1p1 60G 4.0G 57G 7% \/etc\/ceph<br \/>\nshm 64M 8.0K 64M 1% \/dev\/shm<br \/>\ntmpfs 1.9G 0 1.9G 0% \/proc\/acpi<br \/>\ntmpfs 1.9G 0 1.9G 0% \/proc\/scsi<br \/>\ntmpfs 1.9G 0 1.9G 0% \/sys\/firmware<\/p>\n<p>[root@fde05b4a10d6 \/]# cd \/export\/<br \/>\n[root@fde05b4a10d6 export]# ls<br \/>\ntest_ganesha_wr<br \/>\n[root@fde05b4a10d6 export]# cd test_ganesha_wr\/<\/p>\n<p>[root@fde05b4a10d6 test_ganesha_wr]# ls -l<br \/>\ntotal 0<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 00:06 testfile<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:22 testfile2<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 23 19:25 testfile3<\/p>\n<p>&#8230;. this doc will be updated later based on test&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Purpose of this setup: This setup is to test out how nfs-ganesha can be running as a docker process to connect a ceph cluster in docker, get cephfs then export to 3rd host as the nfs server. ## add the nfs-ganesha host to existing ceph cluster&#8217;s host file ## on &#8220;10.8.100.27 ceph01&#8221;, do: [root@ip-10-8-100-27 ~]# [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages\/273"}],"collection":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/comments?post=273"}],"version-history":[{"count":1,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages\/273\/revisions"}],"predecessor-version":[{"id":275,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages\/273\/revisions\/275"}],"wp:attachment":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/media?parent=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}