ocfs2 - OCFS Configuration

19
2014-04
  • bradlis7

    I'm setting up a Virtual Machine, and I'm trying to get OCFS to allow redundancy across two devices. It looks to be working in configuration, but it's not actually syncing the files across:

    /etc/ocfs2/cluster.conf

    cluster:
            node_count = 2
            name = vmcluster
    
    node:
            ip_port = 7777
            ip_address = 198.18.0.25
            number = 1
            name = vm1
            cluster = vmcluster
    
    node:
            ip_port = 7777
            ip_address = 198.18.0.26
            number = 2
            name = vm2
            cluster = vmcluster
    

    /etc/sysconfig/o2cb

    # O2CB_ENABLED: 'true' means to load the driver on boot.
    O2CB_ENABLED=true
    
    # O2CB_STACK: The name of the cluster stack backing O2CB.
    O2CB_STACK=o2cb
    
    # O2CB_BOOTCLUSTER: If not empty, the name of a cluster to start.
    O2CB_BOOTCLUSTER=vmcluster
    
    # O2CB_HEARTBEAT_THRESHOLD: Iterations before a node is considered dead.
    O2CB_HEARTBEAT_THRESHOLD=
    
    # O2CB_IDLE_TIMEOUT_MS: Time in ms before a network connection is considered dead.
    O2CB_IDLE_TIMEOUT_MS=
    
    # O2CB_KEEPALIVE_DELAY_MS: Max time in ms before a keepalive packet is sent
    O2CB_KEEPALIVE_DELAY_MS=
    
    # O2CB_RECONNECT_DELAY_MS: Min time in ms between connection attempts
    O2CB_RECONNECT_DELAY_MS=
    

    Status of OCFS Programs:

    [root@vm1 ~]# /etc/init.d/ocfs2 status
    Configured OCFS2 mountpoints:  /cluster1 /cluster2
    Active OCFS2 mountpoints:  /cluster1 /cluster2
    
    [root@vm1 ~]# /etc/init.d/o2cb status 
    Driver for "configfs": Loaded
    Filesystem "configfs": Mounted
    Stack glue driver: Loaded
    Stack plugin "o2cb": Loaded
    Driver for "ocfs2_dlmfs": Loaded
    Filesystem "ocfs2_dlmfs": Mounted
    Checking O2CB cluster "vmcluster": Online
      Heartbeat dead threshold: 31
      Network idle timeout: 30000
      Network keepalive delay: 2000
      Network reconnect delay: 2000
      Heartbeat mode: Local
    Checking O2CB heartbeat: Active
    

    I see that the heartbeat mode says "Local". I've researched the documentation at http://oss.oracle.com/projects/ocfs2/dist/documentation/v1.6/ocfs2-1_6-usersguide.pdf and old tutorials at http://www.hbyconsultancy.com/blog/shared-ocfs2-partition-on-ubuntu-server-10-04-x64.html and other places. I am not seeing the whole picture it seems...

    I'm using Oracle Linux 3.0.1, which is a modified version of RHEL6.

  • Answers
  • Kendall

    This would be better left as a comment, but I do not have the option. Anyway, regarding your ocfs2 configuration file, the node numbering starts at 0, not 1; so you would have nodes 0 and 1 instead of 1 and 2. I cannot say that will fix your issue, but nonetheless...


  • Related Question

    linux - o2cb thinks ocfs2 cluster is still online, and refuses to shut down
  • Kendall

    I have a handful of OpenSuSE 11.2 servers that utilize OCFS2 volumes. I've noticed that o2cb can't figure out when the OCFS2 cluster is actually mounted. For example, when I try to shutdown o2cb, after stopping OCSF2, o2cb refuses to shutdown because it thinks OCFS2 is still up!

    After stopping OCFS2 I try to stop o2cb...

    hamguy:/dev/disk/by-label # /etc/init.d/o2cb stop
    Stopping O2CB cluster ocfs2: Failed
    Unable to stop cluster as heartbeat region still active
    

    So I check the status...

    hamguy:/dev/disk/by-label # /etc/init.d/o2cb status
    Driver for "configfs": Loaded
    Filesystem "configfs": Mounted
    Stack glue driver: Loaded
    Stack plugin "o2cb": Loaded
    Driver for "ocfs2_dlmfs": Loaded
    Filesystem "ocfs2_dlmfs": Mounted
    Checking O2CB cluster ocfs2: Online
    Heartbeat dead threshold = 31
    Network idle timeout: 30000
    Network keepalive delay: 2000
    Network reconnect delay: 2000
    Checking O2CB heartbeat: Active
    

    And double check OCFS2...

    hamguy:/dev/disk/by-label # /etc/init.d/ocfs2 status
    Configured OCFS2 mountpoints:  /u/conf /u/logs /u/backup /u/client /u/data /u/mdata
    

    OCFS2 is clearly down, while o2cb clearly thinks otherwise.

    The versions of OCFS2 and o2cb are...

    kendall@hamguy:~> rpm -qa |grep ocfs2
    ocfs2console-1.4.1-25.6.x86_64
    ocfs2-tools-o2cb-1.4.1-25.6.x86_64
    ocfs2-tools-1.4.1-25.6.x86_64
    
    kendall@hamguy:~> rpm -qa |grep o2cb
    ocfs2-tools-o2cb-1.4.1-25.6.x86_64
    

    What causes this, and is there a way around it? If I try to reboot the machine, it will just sit there forever until your physically power cycle it. That obviously is a bit of a problem.

    Any insight is appreciated, thank you.

    Kendall


  • Related Answers
  • quanta
    umount -l /dev/device 
    /etc/init.d/o2cb offline ocfs2
    

    make sure that Checking O2CB heartbeat: is INACTIVE when you do /etc/init.d/o2cb status

    if is doesnt change to INACTIVE then remove all its entries from /etc/fstab and reboot.

    Check status again after reboot , if it is INACTIVE then unload and re-enable the nodes using:

    /etc/init.d/o2cb unload
    /etc/init.d/o2cb enable
    

    POINT is the nodes must all be in INACTIVE state before joinging them all to the same heartbeat

    IT WORKED FOR ME