红帽企业存储管理之DRBD应用详解(3)

[root@node2 ~]# uname -rv

2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009

[root@node2 ~]# cat /etc/RedHat-release

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

[root@node2 ~]# hwclock -s

[root@node2 ~]# date

Wed Feb  8 14:02:22 CST 2012

1.2.2查看主机名称,修改查看ip地址

[root@node2 ~]# hostname

node2.junjie.com

[root@node2 ~]# cat /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=node2.junjie.com

[root@node2 ~]# setup

红帽企业存储管理之DRBD应用详解

[root@node2 ~]# service network restart

Shutting down interface eth0:                              [  OK  ]

Shutting down loopback interface:                          [  OK  ]

Bringing up loopback interface:                            [  OK  ]

Bringing up interface eth0:                                [  OK  ]

[root@node2 ~]# ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:0C:29:D1:D4:32 

          inet addr:192.168.101.212  Bcast:192.168.101.255  Mask:255.255.255.0

1.2.3配置/etc/hosts文件(就不用dns了)

[root@node2 ~]# echo "192.168.101.211 node1.junjie.com node1" >>/etc/hosts

[root@node2 ~]# echo "192.168.101.212 node2.junjie.com node2" >>/etc/hosts

1.2.4构建一个新的磁盘空间有利于实现DRBD技术

[root@node2 ~]# fdisk -l

 

Disk /dev/sda: 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/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        1318    10482412+  83  Linux

/dev/sda3            1319        1579     2096482+  82  Linux swap / Solaris

[root@node2 ~]# fdisk /dev/sda

p/n/p//+1000M/p/w

[root@node2 ~]# fdisk -l

 

Disk /dev/sda: 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/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        1318    10482412+  83  Linux

/dev/sda3            1319        1579     2096482+  82  Linux swap / Solaris

/dev/sda4            1580        1702      987997+  83  Linux

[root@node2 ~]# partprobe /dev/sda

[root@node2 ~]# cat /proc/partitions

major minor  #blocks  name

 

   8     0   20971520 sda

   8     1     104391 sda1

   8     2   10482412 sda2

   8     3    2096482 sda3

   8     4     987997 sda4

1.3  在node1和node2上配置ssh密钥信息,

有利于以后在一个节点对另一节点直接操作。

1.3.1  在node1上配置ssh密钥信息

[root@node1 ~]# ssh-keygen -t rsa

[root@node1 ~]# ssh-copy-id -i .ssh/id_rsa.pub root@node2.junjie.com

1.3.2  在node2上配置ssh密钥信息

[root@node2 ~]# ssh-keygen -t rsa

[root@node2 ~]# ssh-copy-id -i .ssh/id_rsa.pub root@node2.junjie.com

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/adc5dac677a24b97b111c042ad3ae756.html