<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 4/4/19 5:52 am, JCA wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFy1yb1YSFJJ3jiZYODZsMfbjMjksyp1N-__8eWqfJJbbU=gKw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div>My apologies for the length of this; I'd
                        rather give to much information than too little.</div>
                      <div><br>
                      </div>
                      <div dir="ltr">I have a simple PaceMaker cluster
                        with two nodes, A and B, that are CentOS 7 VMs. 
                        In both nodes I have a file named my-data.res
                        under /etc/drdb.d, with the following contents
                        (identical in both nodes):</div>
                      <div dir="ltr"><br>
                      </div>
                      <div dir="ltr">
                        <div dir="ltr">          resource my-data {</div>
                        <div dir="ltr">            protocol C;</div>
                        <div dir="ltr">            meta-disk internal;</div>
                        <div dir="ltr">            device /dev/drbd1;</div>
                        <div dir="ltr"><br>
                        </div>
                        <div dir="ltr">            syncer {</div>
                        <div dir="ltr">             verify-alg sha1;</div>
                        <div dir="ltr">            }</div>
                        <div dir="ltr"><br>
                        </div>
                        <div dir="ltr">            net {</div>
                        <div dir="ltr">             allow-two-primaries;</div>
                        <div dir="ltr">            }</div>
                        <div dir="ltr">            on A {</div>
                        <div dir="ltr">             disk /dev/sdb1;</div>
                        <div dir="ltr">             address <a
                            href="http://192.168.123.17:7789"
                            moz-do-not-send="true">192.168.0.5:7789</a>;</div>
                        <div dir="ltr">            }</div>
                        <div dir="ltr"><br>
                        </div>
                        <div dir="ltr">            on B {</div>
                        <div dir="ltr">             disk /dev/sdb1;</div>
                        <div dir="ltr">             address <a
                            href="http://192.168.123.20:7789"
                            moz-do-not-send="true">192.168.0.6:7789</a>;</div>
                        <div dir="ltr">            }</div>
                        <div dir="ltr">          }</div>
                        <div><br>
                        </div>
                      </div>
                      <div dir="ltr">In both A and B, I did the
                        following:<br>
                      </div>
                      <div dir="ltr">
                        <div><br>
                        </div>
                        <div>
                          <div>   # drbdadm create-md my-data</div>
                          <div>   --==  Thank you for participating in
                            the global usage survey  ==--<br>
                          </div>
                          <div>   The server's response is:</div>
                          <div><br>
                          </div>
                          <div>    you are the xxxxxth user to install
                            this version</div>
                          <div>    drbdmeta 1 v08 /dev/sdb1 internal
                            create-md</div>
                          <div><br>
                          </div>
                          <div>    # drbdadm up my-data</div>
                          <div><br>
                          </div>
                          <div>In A alone, I did the following:</div>
                          <div><br>
                          </div>
                          <div>     # drbdadm primary --force my-data</div>
                        </div>
                        <div><br>
                        </div>
                        <div>After this, and  giving time for both nodes
                          to become synchronized,  I get the following
                          in A:</div>
                        <div>
                          <div><br>
                          </div>
                          <div>     # cat /proc/drbd</div>
                          <div>      version: 8.4.11-1
                            (api:1/proto:86-101)<br>
                          </div>
                          <div>      GIT-hash:
                            66145a308421e9c124ec391a7848ac20203bb03c
                            build by mockbuild@, 2018-11-03 01:26:55</div>
                          <div><br>
                          </div>
                          <div>      1: cs:Connected
                            ro:Primary/Secondary ds:UpToDate/UpToDate C
                            r-----ns:2096028 nr:0 dw:0 dr:2098148 al:8
                            bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0</div>
                          <div><br>
                          </div>
                          <div>whereas  the output from the same command
                            in B is</div>
                          <div><br>
                          </div>
                          <div>       version: 8.4.11-1
                            (api:1/proto:86-101)<br>
                          </div>
                          <div>       GIT-hash:
                            66145a308421e9c124ec391a7848ac20203bb03c
                            build by mockbuild@, 2018-11-03 01:26:55</div>
                          <div><br>
                          </div>
                          <div>       1: cs:Connected
                            ro:Secondary/Primary ds:UpToDate/UpToDate C
                            r-----ns:0 nr:2096028 dw:2096028 dr:0 al:8
                            bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0</div>
                          <div><br>
                          </div>
                        </div>
                        <div>In A, I then created a filesystem in the
                          /dev/drbd1 device</div>
                        <div><br>
                        </div>
                        <div>
                          <div>        # mkfs.ext4 /dev/drbd1</div>
                          <div><br>
                          </div>
                          <div>I then mounted it (stil in A)  and
                            populated it with some data, consisting of
                            two files, f1 and f2, unmounting when done.</div>
                          <div><br>
                          </div>
                        </div>
                        <div>After this, I issued the following commands
                          in A:</div>
                        <div><br>
                        </div>
                        <div>
                          <div>        # pcs cluster cib drbd_cfg</div>
                          <div>        # pcs -f drbd_cfg resource create
                            DrbdData ocf:linbit:drbd
                            drbd_resource=my-data op monitor
                            interval=60s</div>
                          <div>        # pcs -f drbd_cfg resource master
                            DrbdDataClone DrbdData master-max=1
                            master-node-max=1 clone-max=2
                            clone-node-max=1 notify=true</div>
                          <div>        # pcs cluster cib-push drbd_cfg<br>
                          </div>
                        </div>
                        <div>
                          <div>        # pcs cluster cib fs_cfg</div>
                          <div>        # pcs -f fs_cfg resource create
                            DrbdFS Filesystem device="/dev/drbd1"
                            directory="/var/lib/my-data" fstype="ext4"</div>
                        </div>
                        <div>        # pcs -f fs_cfg constraint
                          colocation add DrbdFS with DrbdDataClone
                          INFINITY with-rsc-role=Master</div>
                        <div>
                          <div>        # pcs -f fs_cfg constraint order
                            promote DrbdDataClone then start DrbdFS</div>
                          <div>        Adding DrbdDataClone DrbdFS
                            (kind: Mandatory) (Options:
                            first-action=promote then-action=start)</div>
                          <div>        # pcs -f fs_cfg constraint
                            colocation add ClusterIP with DrbdFS
                            INFINITY</div>
                          <div>        # pcs -f fs_cfg constraint order
                            DrbdFS then ClusterIP</div>
                          <div>         Adding DrbdFS ClusterIP (kind:
                            Mandatory) (Options: first-action=start
                            then-action=start)</div>
                          <div>        # pcs cluster cib-push fs_cfg</div>
                          <div>        CIB Updated</div>
                          <div>        # pcs status resources</div>
                          <div>        ClusterIP 
                            (ocf::heartbeat:IPaddr2):  Started A</div>
                          <div>         Master/Slave Set: DrbdDataClone
                            [DrbdData]</div>
                          <div>             Masters: [ A ]</div>
                          <div>             Slaves: [ B ]</div>
                          <div>         DrbdFS 
                            (ocf::heartbeat:Filesystem):  Started A</div>
                        </div>
                        <div><br>
                        </div>
                        <div>The output from the last command in B is
                          very similar,  mutatis mutandis.</div>
                        <div><br>
                        </div>
                        <div>Once this all is done, node A is active
                          where node B is passive. When I do </div>
                        <div><br>
                        </div>
                        <div>           # ls /var/lib/my-data</div>
                        <div><br>
                        </div>
                        <div>in A I can see the f1 and f2 files that I
                          created above. In B, however, there is
                          nothing. My understanding of the DRBD
                          framework tells me that this is expected.</div>
                        <div><br>
                        </div>
                        <div>During this state of affairs (i.e. the
                          cluster up both in A and B, with A being the
                          active node and B being the passive node) I
                          stopped the A node by issuing the following
                          command in A:</div>
                        <div><br>
                        </div>
                        <div>             # pcs cluster stop A</div>
                        <div><br>
                        </div>
                        <div>After this, and giving time for node B to
                          take over, I get the following in B:</div>
                        <div><br>
                        </div>
                        <div>
                          <div>             # pcs status</div>
                          <div>            Cluster name: FirstCluster</div>
                          <div>            Stack: corosync</div>
                          <div>            Current DC: B (version
                            1.1.19-8.el7_6.4-c3c624ea3d) - partition
                            with quorum</div>
                          <div>            Last updated: Wed Apr  3
                            11:49:19 2019</div>
                          <div>            Last change: Wed Apr  3
                            09:53:30 2019 by root via cibadmin on B</div>
                          <div><br>
                          </div>
                          <div>           2 nodes configured</div>
                          <div>           4 resources configured</div>
                          <div><br>
                          </div>
                          <div>           Online: [ B ]</div>
                          <div>           OFFLINE: [ A ]</div>
                          <div><br>
                          </div>
                          <div>           Full list of resources:</div>
                          <div><br>
                          </div>
                          <div>           ClusterIP<span style="white-space:pre">        </span>(ocf::heartbeat:IPaddr2):<span style="white-space:pre">        </span>Started
                            B</div>
                          <div>           Master/Slave Set:
                            DrbdDataClone [DrbdData]</div>
                          <div>               Masters: [ B ]</div>
                          <div>               Stopped: [ A ]</div>
                          <div>           DrbdFS<span style="white-space:pre">        </span>(ocf::heartbeat:Filesystem):<span style="white-space:pre">        </span>Started
                            B</div>
                          <div><br>
                          </div>
                          <div>           Daemon Status:</div>
                          <div>              corosync: active/enabled</div>
                          <div>              pacemaker: active/enabled</div>
                          <div>              pcsd: active/enabled</div>
                        </div>
                        <div><br>
                        </div>
                        <div>On listing the contents of /var/lib/my-data
                          on A, nothing is found there. However, on
                          listing the contents of /var/lib/my-data on B,
                          I find files f1 and f2. So, B has taken over
                          and is now accessing, thanks to DRDB,  the
                          filesystem created in A earlier on.</div>
                        <div><br>
                        </div>
                        <div>Next I started and stopped both A and B
                          (the nodes, not the VMs) until I got back the
                          original situation - namely, A is active, B is
                          passive, /var/log/my-data contains f1 and f2
                          in A, and nothing in B.</div>
                        <div><br>
                        </div>
                        <div>Next I did the following: In A I removed
                          both f1 and f2, and added new files, f3, and
                          f4. I did this while A is the active node.
                          After this I stopped the A node from A as
                          above. Having done this, the output from pcs
                          status in B is as described above. Here's the
                          thing:</div>
                        <div><br>
                        </div>
                        <div>In this situation, when I list the contents
                          of /var/lib/my-data in A, I find it to be
                          empty - as expected, for A has been stopped.
                          When I list the contents of /var/lib/my-data
                          in B, however, what I see is files f1 and f2,
                          not f3 and f4. I was expecting for any changes
                          made on /var/lib/my-data while A was active to
                          be made visible to B when it takes over.</div>
                        <div><br>
                        </div>
                        <div>Is my expectation misplaced? Or perhaps the
                          changes to /var/lib/my-data have to be made by
                          some resource explicitly managed by PaceMaker,
                          while changes done by hand are just dismissed?
                          Notice, however, that if I bring the A node up
                          again, and make it active, on listing
                          /var/lib/my-data on A I see files f3 and f4:
                          the changes I made by hand have not just been
                          dismissed.</div>
                        <div><br>
                        </div>
                        <div>As you can see, I am very confused.</div>
                        <div><br>
                        </div>
                        <br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>I have no idea what all your cluster management commands do, but
      it sounds like you are mounting the underlying device on A instead
      of the DRBD device. Thus, the changes you make are not replicated
      to B.</p>
    <p>While A is active and you see f3 and f4, run df /var/lib/my-data
      and provide the output here, or just note that if the device is
      not /dev/drbd&lt;something&gt; then you have made this mistake.<br>
    </p>
    <p>Hope that this helps...</p>
    <p>Regards,<br>
      Adam<br>
    </p>
    <div class="moz-signature">-- <br>
      Adam Goryachev
      Website Managers
      <a class="moz-txt-link-abbreviated" href="http://www.websitemanagers.com.au">www.websitemanagers.com.au</a></div>
  <div style=3D"clear: both;width:100%;"><br><span style=3D"font-family: Arial, Helvetica, sans-serif; font-size: 10px; clear: both;">-- 
The information in this e-mail is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this e-mail by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you have received this message
in error, please notify us immediately. Please also destroy and delete the
message from your computer. Viruses - Any loss/damage incurred by receiving
this email is not the sender's responsibility.</span><br></div>
</body>
</html>