<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Sorry, got sidetracked with invoicing etc.</div><div class=""><br class=""></div><div class=""><a href="https://bitbucket.org/dismyne/gluster-ansibles/src/6df23803df43/ansible/files/?at=master" class="">https://bitbucket.org/dismyne/gluster-ansibles/src/6df23803df43/ansible/files/?at=master</a></div><div class=""><br class=""></div><div class="">The .service files are the stuff going into SystemD, and they call the test-mounts.sh scripts.</div><div class="">The playbook installing higher up in the directory</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 05 Jun 2017, at 17:45 , Adam Ru &lt;<a href="mailto:ad.ruckel@gmail.com" class="">ad.ruckel@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi hvjunk,<br class=""><br class="">could you please tell me have you had time to check my previous post?<br class=""><br class="">Could you please send me mentioned link to your Gluster Ansible scripts?<br class=""><br class="">Thank you,<br class=""><br class="">Adam<br class=""><br class=""><br class="">On Sun, May 28, 2017 at 2:47 PM, Adam Ru &lt;<a href="mailto:ad.ruckel@gmail.com" class="">ad.ruckel@gmail.com</a>&gt; wrote:<br class=""><blockquote type="cite" class="">Hi hvjunk (Hi Hendrik),<br class=""><br class="">"centos-release-gluster" installs "centos-gluster310". I assume it<br class="">picks the latest version and install it.<br class=""><br class="">Would you be so kind and send me a link to your script &amp; systemd<br class="">service / Ansible scripts? I cannot find a way how to list your posts<br class="">on <a href="http://lists.gluster.org" class="">lists.gluster.org</a> (I assume it's not possible to list posts of a<br class="">specific user). Or if you cannot find it could you please tell me when<br class="">did you post it? I'll try to find it.<br class=""><br class="">Meantime I wrote something very simple but I assume your scripting<br class="">skills are better.<br class=""><br class="">Thank you.<br class=""><br class="">Kind regards.<br class=""><br class="">Adam<br class=""><br class="">----------<br class=""><br class="">sudo sh -c 'cat &gt; /root/gluster-run-ganesha &lt;&lt; EOF<br class="">#!/bin/bash<br class=""><br class="">while true; do<br class=""> &nbsp;&nbsp;&nbsp;echo "Wait"<br class=""> &nbsp;&nbsp;&nbsp;sleep 30<br class=""> &nbsp;&nbsp;&nbsp;if [[ -f /var/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf<br class="">]]; then<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo "Start Ganesha"<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;systemctl start nfs-ganesha.service<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit \$?<br class=""> &nbsp;&nbsp;&nbsp;else<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo "Not mounted"<br class=""> &nbsp;&nbsp;&nbsp;fi<br class="">done<br class="">EOF'<br class=""><br class="">sudo chmod +x /root/gluster-run-ganesha<br class=""><br class="">sudo sh -c 'cat &gt; /etc/systemd/system/custom-gluster-ganesha.service &lt;&lt; EOF<br class="">[Unit]<br class="">Description=Start nfs-ganesha when Gluster shared storage is mounted<br class=""><br class="">[Service]<br class="">Type=oneshot<br class="">ExecStart=/root/gluster-run-ganesha<br class=""><br class="">[Install]<br class="">WantedBy=multi-user.target<br class="">EOF'<br class=""><br class="">sudo systemctl enable custom-gluster-ganesha.service<br class=""><br class="">----------<br class=""><br class=""><br class="">On Mon, May 15, 2017 at 12:27 PM, hvjunk &lt;<a href="mailto:hvjunk@gmail.com" class="">hvjunk@gmail.com</a>&gt; wrote:<br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">On 15 May 2017, at 12:56 PM, Soumya Koduri &lt;<a href="mailto:skoduri@redhat.com" class="">skoduri@redhat.com</a>&gt; wrote:<br class=""><br class=""><br class=""><br class="">On 05/12/2017 06:27 PM, Adam Ru wrote:<br class=""><blockquote type="cite" class="">Hi Soumya,<br class=""><br class="">Thank you very much for last response – very useful.<br class=""><br class="">I apologize for delay, I had to find time for another testing.<br class=""><br class="">I updated instructions that I provided in previous e-mail. *** means<br class="">that the step was added.<br class=""><br class="">Instructions:<br class="">- Clean installation of CentOS 7.3 with all updates, 3x node,<br class="">resolvable IPs and VIPs<br class="">- Stopped firewalld (just for testing)<br class="">- *** SELinux in permissive mode (I had to, will explain bellow)<br class="">- Install “centos-release-gluster" to get "centos-gluster310" repo<br class=""></blockquote></blockquote><br class="">should I also install the centos-gluster310, or will that be automagically chosen by the centos-release-gluster?<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">and install following (nothing else):<br class="">--- glusterfs-server<br class="">--- glusterfs-ganesha<br class="">- Passwordless SSH between all nodes<br class="">(/var/lib/glusterd/nfs/secret.pem and secret.pem.pub on all nodes)<br class="">- systemctl enable and start glusterd<br class="">- gluster peer probe &lt;other nodes&gt;<br class="">- gluster volume set all cluster.enable-shared-storage enable<br class=""></blockquote></blockquote><br class="">After this step, I’ll advise (given my experience in doing this by Ansible) to make sure that the shared filesystem have propagated to all the nodes, as well as the needed entries made in fstab… safety check, and I’ll also load my systemd service and helper script to assist in cluster cold-bootstrapping.<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">- systemctl enable and start pcsd.service<br class="">- systemctl enable pacemaker.service (cannot be started at this moment)<br class="">- Set password for hacluster user on all nodes<br class="">- pcs cluster auth &lt;node 1&gt; &lt;node 2&gt; &lt;node 3&gt; -u hacluster -p blabla<br class="">- mkdir /var/run/gluster/shared_storage/nfs-ganesha/<br class="">- touch /var/run/gluster/shared_storage/nfs-ganesha/ganesha.conf (not<br class="">sure if needed)<br class="">- vi /var/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf and<br class="">insert configuration<br class="">- Try list files on other nodes: ls<br class="">/var/run/gluster/shared_storage/nfs-ganesha/<br class="">- gluster nfs-ganesha enable<br class="">- *** systemctl enable pacemaker.service (again, since pacemaker was<br class="">disabled at this point)<br class="">- *** Check owner of "state", "statd", "sm" and "sm.bak" in<br class="">/var/lib/nfs/ (I had to: chown rpcuser:rpcuser<br class="">/var/lib/nfs/statd/state)<br class="">- Check on other nodes that nfs-ganesha.service is running and "pcs<br class="">status" shows started resources<br class="">- gluster volume create mynewshare replica 3 transport tcp<br class="">node1:/&lt;dir&gt; node2:/&lt;dir&gt; node3:/&lt;dir&gt;<br class="">- gluster volume start mynewshare<br class="">- gluster vol set mynewshare ganesha.enable on<br class=""><br class="">At this moment, this is status of important (I think) services:<br class=""><br class="">-- corosync.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disabled<br class="">-- corosync-notifyd.service &nbsp;&nbsp;&nbsp;&nbsp;disabled<br class="">-- glusterd.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled<br class="">-- glusterfsd.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disabled<br class="">-- pacemaker.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled<br class="">-- pcsd.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled<br class="">-- nfs-ganesha.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disabled<br class="">-- nfs-ganesha-config.service &nbsp;&nbsp;static<br class="">-- nfs-ganesha-lock.service &nbsp;&nbsp;&nbsp;&nbsp;static<br class=""><br class="">-- corosync.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;active (running)<br class="">-- corosync-notifyd.service &nbsp;&nbsp;&nbsp;&nbsp;inactive (dead)<br class="">-- glusterd.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;active (running)<br class="">-- glusterfsd.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inactive (dead)<br class="">-- pacemaker.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;active (running)<br class="">-- pcsd.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;active (running)<br class="">-- nfs-ganesha.service &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;active (running)<br class="">-- nfs-ganesha-config.service &nbsp;&nbsp;inactive (dead)<br class="">-- nfs-ganesha-lock.service &nbsp;&nbsp;&nbsp;&nbsp;active (running)<br class=""><br class="">May I ask you a few questions please?<br class=""><br class="">1. Could you please confirm that services above has correct status/state?<br class=""></blockquote><br class="">Looks good to the best of my knowledge.<br class=""><br class=""><blockquote type="cite" class=""><br class="">2. When I restart a node then nfs-ganesha is not running. Of course I<br class="">cannot enable it since it needs to be enabled after shared storage is<br class="">mounted. What is best practice to start it automatically so I don’t<br class="">have to worry about restarting node? Should I create a script that<br class="">will check whether shared storage was mounted and then start<br class="">nfs-ganesha? How do you do this in production?<br class=""></blockquote><br class="">That's right.. We have plans to address this in near future (probably by having a new .service which mounts shared_storage before starting nfs-ganesha). But until then ..yes having a custom defined script to do so is the only way to automate it.<br class=""></blockquote><br class="">Refer to my previous posting that has a script &amp; systemd service that address this problematic bootstrapping issue w.r.t. locally mounted gluster directories, which the shared directory is.<br class="">That could be used (with my permission) as a basis to help fix this issue…<br class=""><br class=""></blockquote><br class=""><br class=""><br class="">--<br class="">Adam<br class=""></blockquote><br class=""><br class=""><br class="">-- <br class="">Adam<br class=""></div></div></blockquote></div><br class=""></div></body></html>