openfielr 2.3 cluster 配置测试

[BEGIN] 2016/6/8 7:56:13
[root@openfiler01 ~]# hostname
openfiler01
[root@openfiler01 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        localhost.localdomain localhost
192.168.1.155    openfiler01
192.168.1.156    openfiler02
10.10.5.155      openfiler01-priv
10.10.5.156      openfiler02-priv
192.158.1.157    openfiler-vip
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
root@openfiler02's password:
Last login: Wed Jun  8 07:55:57 2016 from 192.168.1.1
[root@openfiler02 ~]# hostname
openfiler02
[root@openfiler02 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        localhost.localdomain localhost
192.168.1.155    openfiler01
192.168.1.156    openfiler02
10.10.5.155      openfiler01-priv
10.10.5.156      openfiler02-priv
192.158.1.157    openfiler-vip
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# arch
x86_64
[root@openfiler01 ~]# uname -a
Linux openfiler01 2.6.24.7-0.2.6.smp.gcc3.4.x86_64 #1 SMP Thu May 29 07:57:14 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
53:16:d1:90:6a:7b:94:24:88:50:c8:06:7a:5d:ee:55 root@openfiler01
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
root@openfiler02's password:
Permission denied, please try again.
root@openfiler02's password:
Permission denied, please try again.
root@openfiler02's password:
Last login: Wed Jun  8 07:56:42 2016 from openfiler01
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# ssh-keygen -t dsa
Generating public/private dsa key pair.

Enter file in which to save the key (/root/.ssh/id_dsa): Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
60:b3:d0:9e:a8:c0:8f:b7:f1:cf:40:f0:05:0b:ec:5a root@openfiler02
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]# scp .ssh/id_dsa.pub root@openfiler02:~/.ssh/authorized_keys2
root@openfiler02's password:
id_dsa.pub                                                                                                                100%  606     0.6KB/s   00:00   
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
Last login: Wed Jun  8 07:57:53 2016 from openfiler01
[root@openfiler02 ~]# scp .ssh/id_dsa.pub root@openfiler01:~/.ssh/authorized_keys2
The authenticity of host 'openfiler01 (192.168.1.155)' can't be established.
RSA key fingerprint is 66:df:47:a2:be:b1:0f:8d:4e:25:50:c7:b8:a6:52:cc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'openfiler01,192.168.1.155' (RSA) to the list of known hosts.
root@openfiler01's password:
id_dsa.pub                                                                                                                100%  606     0.6KB/s   00:00   
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# ssh openfiler01
Last login: Wed Jun  8 07:55:46 2016 from 192.168.1.1
[root@openfiler01 ~]# exit
logout
Connection to openfiler01 closed.
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# mv /etc/drbd.conf /etc/drbd.conf.org
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# vi /etc/drbd.conf
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# cat /etc/drbd.conf
global {
# minor-count 64;
# dialog-refresh 5; # 5 seconds
# disable-ip-verification;
usage-count ask;
}
common {
syncer { rate 100M; }
}
resource cluster_metadata {
protocol C;
handlers {
pri-on-incon-degr "echo O > /proc/sysrq-trigger ; halt -f";
pri-lost-after-sb "echo O > /proc/sysrq-trigger ; halt -f";
local-io-error "echo O > /proc/sysrq-trigger ; halt -f";
# outdate-peer "/usr/sbin/drbd-peer-outdater";
}
startup {
# wfc-timeout 0;
degr-wfc-timeout 120; # 2 minutes.
}
disk {
on-io-error detach;
}
net {
after-sb-0pri disconnect;
after-sb-1pri disconnect;
after-sb-2pri disconnect;
rr-conflict disconnect;
}
syncer {
# rate 10M;
# after "r2";
al-extents 257;
}
on openfiler01 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.1.155:7788;
meta-disk internal;
}
on openfiler02 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.1.156:7788;
meta-disk internal;
}
}
resource vg0drbd {
protocol C;
startup {
wfc-timeout 0; ## Infinite!
degr-wfc-timeout 120; ## 2 minutes.
}
disk {
on-io-error detach;
}
net {
# timeout 60;
# connect-int 10;
# ping-int 10;
# max-buffers 2048;
# max-epoch-size 2048;
}
syncer {
after "cluster_metadata";
}
on openfiler01 {
device /dev/drbd1;
disk /dev/sdb2;
address 192.168.1.155:7789;
meta-disk internal;
}
on openfiler02 {
device /dev/drbd1;
disk /dev/sdb2;
address 192.168.1.156:7789;
meta-disk internal;
}
}
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# scp /etc/drbd.conf openfiler02:/etc/
drbd.conf                                                                                                                 100% 1354     1.3KB/s   00:00   
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# service iptables status
Firewall is stopped.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# fdisk -l

Disk /dev/sda: 17.1 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1834    14627182+  83  Linux
/dev/sda3            1835        2088     2040255   82  Linux swap / Solaris

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
[root@openfiler01 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): +500M

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (63-2610, default 63):
Using default value 63
Last cylinder or +size or +sizeM or +sizeK (63-2610, default 2610):
Using default value 2610

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@openfiler01 ~]# partprobe
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# fdisk -l

Disk /dev/sda: 17.1 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1834    14627182+  83  Linux
/dev/sda3            1835        2088     2040255   82  Linux swap / Solaris

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          62      497983+  83  Linux
/dev/sdb2              63        2610    20466810   8e  Linux LVM
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
Last login: Wed Jun  8 07:58:31 2016 from openfiler01
[root@openfiler02 ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
[root@openfiler02 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): +500M

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (63-2610, default 63):
Using default value 63
Last cylinder or +size or +sizeM or +sizeK (63-2610, default 2610):
Using default value 2610

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@openfiler02 ~]# partprobe
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          62      497983+  83  Linux
/dev/sdb2              63        2610    20466810   8e  Linux LVM
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# drbdadm create-md cluster_metadata

                --== This is a new installation of DRBD ==--
Please take part in the global DRBD usage count at http://usage.drbd.org.

The conter works completely anonymous. A random number gets created on
you machine, and that randomer number (as identifier for this machine) and
DRBD's version number are sent to usage.drbd.org.

The benifits for you are:
* As a respose to your data, the server (usage.drbd.org) will tell you
   how many users before you have installed this version (8.0.11).
* With a high counter the DRBD developers have a high motivation to
   continue development of the software.

http://usage.drbd.org/cgi-bin/in ... 86883eb9e2a0d3a5b1b

In case you want to participate but know that this machines is firewalled
simply issue the query string with your favourite web browser or wget.
You can control all this by setting 'usage-count' in your drbd.conf.

* You may enter a free form comment about your machine, that gets
  used on usage.drbd.org instead of the big random number.
* Enter 'no' to opt out.
* To count this node without comment, just press [RETURN]




















  --==  Thank you for participating in the global usage survey  ==--
The server's response is:



In the future drbdadm will only contact usage.drbd.org when you update
DRBD or when you use 'drbdadm create-md'. Of course it will continue
to ask you for confirmation as long as 'usage-count' is at its default
value of 'ask'.

Just press [enter] to continue: v08 Magic number not found
v07 Magic number not found
v07 Magic number not found
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.

                --== Creating metadata ==--
As with nodes we count the total number of devices mirrored by DRBD at
at http://usage.drbd.org.

The counter works completely anonymous. A random number gets created for
this device, and that randomer number and the devices size will be sent.

http://usage.drbd.org/cgi-bin/in ... 49&rs=509935104

Enter 'no' to opt out, or just press [return] to continue:

[root@openfiler01 ~]#
[root@openfiler01 ~]# drbdadm create-md vg0drbd
v08 Magic number not found
v07 Magic number not found
v07 Magic number not found
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.

                --== Creating metadata ==--
As with nodes we count the total number of devices mirrored by DRBD at
at http://usage.drbd.org.

The counter works completely anonymous. A random number gets created for
this device, and that randomer number and the devices size will be sent.

http://usage.drbd.org/cgi-bin/in ... &rs=20958013440

Enter 'no' to opt out, or just press [return] to continue:


[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
Last login: Wed Jun  8 08:07:45 2016 from openfiler01
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# drbdadm create-md cluster_metadata

                --== This is a new installation of DRBD ==--
Please take part in the global DRBD usage count at http://usage.drbd.org.

The conter works completely anonymous. A random number gets created on
you machine, and that randomer number (as identifier for this machine) and
DRBD's version number are sent to usage.drbd.org.

The benifits for you are:
* As a respose to your data, the server (usage.drbd.org) will tell you
   how many users before you have installed this version (8.0.11).
* With a high counter the DRBD developers have a high motivation to
   continue development of the software.

http://usage.drbd.org/cgi-bin/in ... 86883eb9e2a0d3a5b1b

In case you want to participate but know that this machines is firewalled
simply issue the query string with your favourite web browser or wget.
You can control all this by setting 'usage-count' in your drbd.conf.

* You may enter a free form comment about your machine, that gets
  used on usage.drbd.org instead of the big random number.
* Enter 'no' to opt out.
* To count this node without comment, just press [RETURN]




















  --==  Thank you for participating in the global usage survey  ==--
The server's response is:









In the future drbdadm will only contact usage.drbd.org when you update
DRBD or when you use 'drbdadm create-md'. Of course it will continue
to ask you for confirmation as long as 'usage-count' is at its default
value of 'ask'.

Just press [enter] to continue: v08 Magic number not found
v07 Magic number not found
v07 Magic number not found
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.

                --== Creating metadata ==--
As with nodes we count the total number of devices mirrored by DRBD at
at http://usage.drbd.org.

The counter works completely anonymous. A random number gets created for
this device, and that randomer number and the devices size will be sent.

http://usage.drbd.org/cgi-bin/in ... 14&rs=509935104

Enter 'no' to opt out, or just press [return] to continue:
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# drbdadm create-md vg0drbd
v08 Magic number not found
v07 Magic number not found
v07 Magic number not found
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.

                --== Creating metadata ==--
As with nodes we count the total number of devices mirrored by DRBD at
at http://usage.drbd.org.

The counter works completely anonymous. A random number gets created for
this device, and that randomer number and the devices size will be sent.

http://usage.drbd.org/cgi-bin/in ... &rs=20958013440

Enter 'no' to opt out, or just press [return] to continue:






[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# service drbd status
drbd not loaded
[root@openfiler01 ~]# service drbd start
Starting DRBD resources:    [ d(cluster_metadata) d(vg0drbd) s(cluster_metadata) s(vg0drbd) n(cluster_metadata) n(vg0drbd) ].

                --== This is an update of DRBD ==--
Please take part in the global DRBD usage count at http://usage.drbd.org.

The conter works completely anonymous. A random number gets created on
you machine, and that randomer number (as identifier for this machine) and
DRBD's version number are sent to usage.drbd.org.

The benifits for you are:
* As a respose to your data, the server (usage.drbd.org) will tell you
   how many users before you have installed this version (8.0.11).
* With a high counter the DRBD developers have a high motivation to
   continue development of the software.

http://usage.drbd.org/cgi-bin/in ... 9638dce591782f947e3

In case you want to participate but know that this machines is firewalled
simply issue the query string with your favourite web browser or wget.
You can control all this by setting 'usage-count' in your drbd.conf.

* You may enter a free form comment about your machine, that gets
  used on usage.drbd.org instead of the big random number.
* Enter 'no' to opt out.
* To count this node without comment, just press [RETURN]




















  --==  Thank you for participating in the global usage survey  ==--
The server's response is:


In the future drbdadm will only contact usage.drbd.org when you update
DRBD or when you use 'drbdadm create-md'. Of course it will continue
to ask you for confirmation as long as 'usage-count' is at its default
value of 'ask'.

Just press [enter] to continue:


[root@openfiler02 ~]# service drbd start
Starting DRBD resources:    [ d(cluster_metadata) d(vg0drbd) s(cluster_metadata) s(vg0drbd) n(cluster_met

                --== This is an update of DRBD ==--
Please take part in the global DRBD usage count at http://usage.drbd.org.

The conter works completely anonymous. A random number gets created on
you machine, and that randomer number (as identifier for this machine) and
DRBD's version number are sent to usage.drbd.org.

The benifits for you are:
* As a respose to your data, the server (usage.drbd.org) will tell you
   how many users before you have installed this version (8.0.11).
* With a high counter the DRBD developers have a high motivation to
   continue development of the software.

http://usage.drbd.org/cgi-bin/in ... e32adb87d9638dce591

In case you want to participate but know that this machines is firewalled
simply issue the query string with your favourite web browser or wget.
You can control all this by setting 'usage-count' in your drbd.conf.

* You may enter a free form comment about your machine, that gets
  used on usage.drbd.org instead of the big random number.
* Enter 'no' to opt out.
* To count this node without comment, just press [RETURN]




















  --==  Thank you for participating in the global usage survey  ==--
The server's response is:




In the future drbdadm will only contact usage.drbd.org when you update
DRBD or when you use 'drbdadm create-md'. Of course it will continue
to ask you for confirmation as long as 'usage-count' is at its default
value of 'ask'.

Just press [enter] to continue: [root@openfiler02 ~]#
[root@openfiler02 ~]#






[root@openfiler01 ~]# service drbd start
Starting DRBD resources:    [ ].
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                   ds                         p  mounted  fstype
0:cluster_metadata  Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
1:vg0drbd           Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
[root@openfiler02 ~]# service drbd start
Starting DRBD resources:    [ ].
[root@openfiler02 ~]# servcice drbd status
-bash: servcice: command not found
[root@openfiler02 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                   ds                         p  mounted  fstype
0:cluster_metadata  Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
1:vg0drbd           Connected  Secondary/Secondary  Inconsistent/Inconsistent  C

Last login: Wed Jun  8 08:20:24 2016 from openfiler01
[root@openfiler02 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                   ds                         p  mounted  fstype
0:cluster_metadata  Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
1:vg0drbd           Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# drbdsetup /dev/drbd0 primary –o
State change failed: (-2) Refusing to be Primary without at least one UpToDate disk
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                   ds                         p  mounted  fstype
0:cluster_metadata  Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
1:vg0drbd           Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                   ds                         p  mounted  fstype
0:cluster_metadata  Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
1:vg0drbd           Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                   ds                         p  mounted  fstype
0:cluster_metadata  Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
1:vg0drbd           Connected  Secondary/Secondary  Inconsistent/Inconsistent  C
[root@openfiler01 ~]# drbdsetup /dev/drbd0 primary -o

USAGE: drbdsetup device command arguments options

Device is usually /dev/drbdX or /dev/drbd/X.
General options: --create-device, --set-defaults

Commands are:
primary [opts...]                       secondary                              
disk [args...] [opts...]                detach                                 
net [args...] [opts...]                 disconnect                             
resize [opts...]                        syncer [opts...]                       
invalidate                              invalidate-remote                     
pause-sync                              resume-sync                           
suspend-io                              resume-io                              
outdate                                 down                                   
state                                   cstate                                 
dstate                                  show-gi                                
get-gi                                  show                                   
events [opts...]                        wait-connect [opts...]                 
wait-sync [opts...]                    

To get more details about a command issue 'drbdsetup help cmd'.


invalid command
[root@openfiler01 ~]# drbdsetup /dev/drbd0 primary -o
[root@openfiler01 ~]# drbdsetup /dev/drbd1 primary -o
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs          st                 ds                     p  mounted  fstype
0:cluster_metadata  Connected   Primary/Secondary  UpToDate/UpToDate      C
1:vg0drbd           SyncSource  Primary/Secondary  UpToDate/Inconsistent  C
...                 sync'ed:    1.5%               (19706/19986)M
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs          st                 ds                     p  mounted  fstype
0:cluster_metadata  Connected   Primary/Secondary  UpToDate/UpToDate      C
1:vg0drbd           SyncSource  Primary/Secondary  UpToDate/Inconsistent  C
...                 sync'ed:    4.3%               (19141/19986)M
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs          st                 ds                     p  mounted  fstype
0:cluster_metadata  Connected   Primary/Secondary  UpToDate/UpToDate      C
1:vg0drbd           SyncSource  Primary/Secondary  UpToDate/Inconsistent  C
...                 sync'ed:    4.9%               (19022/19986)M
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs          st                 ds                     p  mounted  fstype
0:cluster_metadata  Connected   Primary/Secondary  UpToDate/UpToDate      C
1:vg0drbd           SyncSource  Primary/Secondary  UpToDate/Inconsistent  C
...                 sync'ed:    40.6%              (11882/19986)M
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs          st                 ds                     p  mounted  fstype
0:cluster_metadata  Connected   Primary/Secondary  UpToDate/UpToDate      C
1:vg0drbd           SyncSource  Primary/Secondary  UpToDate/Inconsistent  C
...                 sync'ed:    58.4%              (8330/19986)M
[root@openfiler01 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.12 (api:86/proto:86)
GIT-hash: 5c9f89594553e32adb87d9638dce591782f947e3 build by phil@mescal, 2008-04-24 13:29:44
m:res               cs         st                 ds                 p  mounted  fstype
0:cluster_metadata  Connected  Primary/Secondary  UpToDate/UpToDate  C
1:vg0drbd           Connected  Primary/Secondary  UpToDate/UpToDate  C
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# chkconfig --level 2345 drbd on
[root@openfiler01 ~]# ssh openfiler02
Last login: Wed Jun  8 08:34:58 2016 from openfiler01
[root@openfiler02 ~]# chkconfig --level 2345 drbd on
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# mkfs.ext3 /dev/drbd0
mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
124928 inodes, 497928 blocks
24896 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
61 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done                           
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# vi /etc/lvm/lvm.conf
[root@openfiler01 ~]# grep sdb /etc/lvm/lvm.conf
     filter = [ "r|/dev/sdb2|" ]
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# scp /etc/lvm/lvm.conf openfiler02:/etc/lvm/
lvm.conf                                                                                                                  100%   16KB  15.6KB/s   00:00   
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# vi /etc/ha.d/authkeys
[root@openfiler01 ~]# scp /etc/ha.d/authkeys openfiler02:/etc/ha.d/
authkeys                                                                                                                  100%   13     0.0KB/s   00:00   
[root@openfiler01 ~]# cd /etc/ha.d/
[root@openfiler01 ha.d]# chmod 600 /etc/ha.d/authkeys
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]# ssh openfiler02
Last login: Wed Jun  8 08:41:04 2016 from openfiler01
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# chmod 600 /etc/ha.d/authkeys
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]# pwd
/etc/ha.d
[root@openfiler01 ha.d]# vi ha.cf
[root@openfiler01 ha.d]# scp ha.cf openfiler02:/etc/ha.d/
ha.cf                                                                                                                     100%  196     0.2KB/s   00:00   
[root@openfiler01 ha.d]# chkconfig --level 2345 heartbeat on
[root@openfiler01 ha.d]# ssh openfiler02
Last login: Wed Jun  8 08:44:19 2016 from openfiler01
[root@openfiler02 ~]# chkconfig --level 2345 heartbeat on
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]# cd
[root@openfiler01 ~]# mkdir /cluster_metadata
[root@openfiler01 ~]# mount /dev/drbd0 /cluster_metadata
[root@openfiler01 ~]# mount
/dev/sda2 on / type ext3 (rw)
/proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/drbd0 on /cluster_metadata type ext3 (rw)
[root@openfiler01 ~]# mv /opt/openfiler/ /opt/openfiler.local
[root@openfiler01 ~]# mkdir /cluster_metadata/opt
[root@openfiler01 ~]# cp -a /opt/openfiler.local /cluster_metadata/opt/openfiler
[root@openfiler01 ~]# ln -s /cluster_metadata/opt/openfiler /opt/openfiler
[root@openfiler01 ~]# rm /cluster_metadata/opt/openfiler/sbin/openfiler
rm: remove symbolic link `/cluster_metadata/opt/openfiler/sbin/openfiler'? y
[root@openfiler01 ~]# ln -s /usr/sbin/httpd /cluster_metadata/opt/openfiler/sbin/openfiler
[root@openfiler01 ~]# rm /cluster_metadata/opt/openfiler/etc/rsync.xml
rm: remove regular file `/cluster_metadata/opt/openfiler/etc/rsync.xml'? y
[root@openfiler01 ~]# ln -s /opt/openfiler.local/etc/rsync.xml /cluster_metadata/opt/openfiler/etc/
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# vi /opt/openfiler.local/etc/rsync.xml
[root@openfiler01 ~]# cat /opt/openfiler.local/etc/rsync.xml
<?xml version="1.0" ?>
<rsync>
<remote hostname="192.168.1.156"/> ## IP address of peer node.
<item path="/etc/ha.d/haresources"/>
<item path="/etc/ha.d/ha.cf"/>
<item path="/etc/ldap.conf"/>
<item path="/etc/openldap/ldap.conf"/>
<item path="/etc/ldap.secret"/>
<item path="/etc/nsswitch.conf"/>
<item path="/etc/krb5.conf"/>
</rsync>

[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# mkdir -p /cluster_metadata/etc/httpd/conf.d
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
Last login: Wed Jun  8 08:46:02 2016 from openfiler01
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# mkdir /cluster_metadata
[root@openfiler02 ~]# mv /opt/openfiler/ /opt/openfiler.local
[root@openfiler02 ~]# ln -s /cluster_metadata/opt/openfiler /opt/openfiler
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# vi /opt/openfiler.local/etc/rsync.xml
[root@openfiler02 ~]# cat /opt/openfiler.local/etc/rsync.xml
<?xml version="1.0" ?>
<rsync>
<remote hostname="192.168.1.155"/> ## IP address of peer node.
<item path="/etc/ha.d/haresources"/>
<item path="/etc/ha.d/ha.cf"/>
<item path="/etc/ldap.conf"/>
<item path="/etc/openldap/ldap.conf"/>
<item path="/etc/ldap.secret"/>
<item path="/etc/nsswitch.conf"/>
<item path="/etc/krb5.conf"/>
</rsync>

[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# vi /cluster_metadata/opt/openfiler/etc/cluster.xml
[root@openfiler02 ~]# ls -la
total 396
drwxr-x---   3 root root   4096 Jun  8 08:55 .
drwxr-xr-x  24 root root   4096 Jun  8 08:50 ..
-rw-------   1 root root   1296 Jun  7 18:54 anaconda-ks.cfg
-rw-------   1 root root    531 Jun  8 08:46 .bash_history
-rw-r--r--   1 root root     24 Jun 10  2000 .bash_logout
-rw-r--r--   1 root root    234 Jul  5  2001 .bash_profile
-rw-r--r--   1 root root    176 Aug 23  1995 .bashrc
-rw-r--r--   1 root root 186833 Jun  7 18:54 conary-tag-script
-rwxr-xr-x   1 root root  68828 Jun  7 18:54 conary-tag-script.output
-rw-r--r--   1 root root    210 Jun 10  2000 .cshrc
-rw-r--r--   1 root root  78019 Jun  7 18:54 install.log
-rw-r--r--   1 root root    682 Jun  7 18:54 install.log.syslog
drwx------   2 root root   4096 Jun  8 07:58 .ssh
-rw-r--r--   1 root root    196 Jul 11  2000 .tcshrc
-rw-------   1 root root   1125 Jun  8 08:55 .viminfo
-rw-r--r--   1 root root   1126 Aug 23  1995 .Xresources
[root@openfiler02 ~]# cd /cluster_metadata/
[root@openfiler02 cluster_metadata]# ls
[root@openfiler02 cluster_metadata]# mount
/dev/sda2 on / type ext3 (rw)
/proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
[root@openfiler02 cluster_metadata]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# vi /cluster_metadata/opt/openfiler/etc/cluster.xml
[root@openfiler01 ~]# vi /cluster_metadata/opt/openfiler/etc/cluster.xml
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# cat /cluster_metadata/opt/openfiler/etc/cluster.xml
<?xml version="1.0" ?>
<cluster>
<clustering state="on" />
<nodename value="openfiler01" />
<resource value="MailTo::mundotic.ecampos@gmail.com::ClusterFailover"/>
<resource value="IPaddr::192.168.1.157/24" />
<resource value="drbddisk::">
<resource value="LVM::vg0drbd">
<resource value="Filesystem::/dev/drbd0::/cluster_metadata::ext3::defaults,noatime">
<resource value="MakeMounts"/>
</cluster>
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# mv /etc/ietd.conf /cluster_metadata/etc/
[root@openfiler01 ~]# ln -s /cluster_metadata/etc/ietd.conf /etc/ietd.conf
[root@openfiler01 ~]# mv /etc/initiators.allow /cluster_metadata/etc/
[root@openfiler01 ~]# ln -s /cluster_metadata/etc/initiators.allow /etc/initiators.allow
[root@openfiler01 ~]# mv /etc/initiators.deny /cluster_metadata/etc/
[root@openfiler01 ~]# ln -s /cluster_metadata/etc/initiators.deny /etc/initiators.deny
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# ssh openfiler02
Last login: Wed Jun  8 08:50:26 2016 from openfiler01
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# rm /etc/ietd.conf
rm: remove regular file `/etc/ietd.conf'? y
[root@openfiler02 ~]# ln -s /cluster_metadata/etc/ietd.conf /etc/ietd.conf
[root@openfiler02 ~]# rm /etc/initiators.allow
rm: remove regular file `/etc/initiators.allow'? y
[root@openfiler02 ~]# ln -s /cluster_metadata/etc/initiators.allow /etc/initiators.allow
[root@openfiler02 ~]# rm /etc/initiators.deny
rm: remove regular file `/etc/initiators.deny'? y
[root@openfiler02 ~]# ln -s /cluster_metadata/etc/initiators.deny /etc/initiators.deny
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]#
[root@openfiler02 ~]# exit
logout
Connection to openfiler02 closed.
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# pvcreate /dev/drbd1
  Physical volume "/dev/drbd1" successfully created
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# rm /opt/openfiler/etc/httpd/modules
rm: remove symbolic link `/opt/openfiler/etc/httpd/modules'? y
[root@openfiler01 ~]# ln -s /usr/lib64/httpd/modules /opt/openfiler/etc/httpd/modules
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# service openfiler restart
Stopping openfiler:                                        [  OK  ]
Starting openfiler:                                        [  OK  ]
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# lvcreate -L 18G -n filer vg0drbd
  Volume group "vg0drbd" not found
[root@openfiler01 ~]# vgcreate vg0drbd /dev/drbd1
  Volume group "vg0drbd" successfully created
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# lvcreate -L 18G -n filer vg0drbd
  Logical volume "filer" created
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]#
[root@openfiler01 ~]# cd /etc/ha.d
[root@openfiler01 ha.d]# ls
authkeys  ha.cf  harc  rc.d  README.config  resource.d  shellfuncs
[root@openfiler01 ha.d]# ls
authkeys  ha.cf  harc  haresources  rc.d  README.config  resource.d  shellfuncs
[root@openfiler01 ha.d]# scp /etc/ha.d/haresources root@openfiler02:/etc/ha.d/
haresources                                                           100%  219     0.2KB/s   00:00   
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]#
[root@openfiler01 ha.d]# shutdown -r now

Broadcast message from root (pts/0) (Wed Jun  8 09:08:44 2016):

The system is going down for reboot NOW!
[root@openfiler01 ha.d]#
Connection closed by foreign host.

Disconnected from remote host(192.168.1.155:22) at 09:09:37.

Type `help' to learn how to use Xshell prompt.
[c:\~]$ ssh 192.168.1.155


Connecting to 192.168.1.155:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Wed Jun  8 07:58:51 2016 from openfiler02
[root@openfiler01 ~]# shutdown -h now

Broadcast message from root (pts/0) (Wed Jun  8 09:14:30 2016):

The system is going down for system halt NOW!
[root@openfiler01 ~]#
Connection closed by foreign host.

Disconnected from remote host(192.168.1.155:22) at 09:15:34.

Type `help' to learn how to use Xshell prompt.
标签: 暂无标签
dongxujian

写了 86 篇文章,拥有财富 384,被 13 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

成为第一个吐槽的人

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈