czwartek, września 06, 2012

Klaster w RHEL 6

ccs_tool create eai-cluster-01 -2
cat /etc/cluster/cluster.conf


<?xml version="1.0"?>
<cluster name="eai-cluster-01" config_version="1">
  <dlm enable-fencing="0"/>

  <clusternodes>
    <clusternode name="eai1" votes="1" nodeid="1">
      <fence>
        <!--method name="single">
        </method-->
      </fence>
    </clusternode>
    <clusternode name="eai2" votes="1" nodeid="2">
      <fence>
        <!--method name="single">
        </method-->
      </fence>
    </clusternode>
  </clusternodes>

  <fencedevices>
  </fencedevices>

  <rm>
    <resources/>
    <service autostart="1" name="store">    
        <fs device="/dev/drbd1"
        mountpoint="/mnt/eai-store-01" fstype="gfs2"
        name="drbd-eai-store-01 " options="noatime"/>   
    </service>
    <failoverdomains/>    
  </rm>
</cluster>

cat /etc/corosync/corosync.conf

compatibility: whitetank

totem {
    version: 2
    secauth: off
    threads: 0
    interface {
        ringnumber: 0
        bindnetaddr: 192.168.7.1
        mcastaddr: 226.94.1.1
        mcastport: 5405
        ttl: 1
    }
}

logging {
    fileline: off
    to_stderr: no
    to_logfile: yes
    to_syslog: yes
    logfile: /var/log/cluster/corosync.log
    debug: on
    timestamp: on
    logger_subsys {
        subsys: AMF
        debug: off
    }
}

amf {
    mode: disabled
}

cat /etc/drbd.d/eai-store-01.res

resource eai-store-01 {
    startup {
      become-primary-on both;

      wfc-timeout 35;
      degr-wfc-timeout 35; 
      outdated-wfc-timeout 35;     
    }
    net {
      protocol C;
      allow-two-primaries yes;
      verify-alg sha1;

#    data-integrity-alg sha1;
      csums-alg md5;
   
      connect-int 20;
      ping-int 15;
      timeout 10;
      cram-hmac-alg sha1;
      shared-secret b21372y3egsg613;
   
      after-sb-0pri discard-zero-changes;
      after-sb-1pri violently-as0p;
      after-sb-2pri
violently-as0p;
    }
    disk {
     on-io-error pass_on;
     fencing dont-care;

     disk-timeout 5000;
    }
    on eai1 {
     volume 0 {
        device minor 1;
        disk /dev/sdb1;
        meta-disk internal;       
     }
     address 192.168.7.71:7789;
    }
    on eai2 {
     volume 0 {
        device minor 1;
        disk /dev/sdb1;
        meta-disk internal;       
     }
     address 1
92.168.7.72:7789;
    }


chkconfig iptables off
chkconfig cman on
/etc/init.d/cman start
modprobe drbd

mv /usr/etc/* /etc/ #drbd --prefix=/usr

drbdadm create-md eai-store-01
drdbadm up eai-store-01
mkfs.gfs2 -j3 -t eai-cluster-01:eai-store-01 /dev/drbd1
mount /dev/drbd1 /mnt/eai-store-01
chkconfig gfs2 on
chkconfig drbd on
chown -R nfsnobody:nfsnobody /mnt/eai-store-01/ems/config/datastore
 

0 komentarze: