集群
2016-09-27 20:48
134 查看
集群
安装软件
1.都把yum源改成:
# repos on instructor for classroom use
# Main rhel6.5 server
[base]
name=Instructor Server Repository
baseurl=ftp://172.25.99.250/pub/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# HighAvailability rhel6.5
[HighAvailability]
name=Instructor HighAvailability Repository
baseurl=ftp://172.25.99.250/pub/HighAvailability
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# LoadBalancer packages
[LoadBalancer]
name=Instructor LoadBalancer Repository
baseurl=ftp://172.25.99.250/pub/LoadBalancer
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# ResilientStorage
[ResilientStorage]
name=Instructor ResilientStorage Repository
baseurl=ftp://172.25.99.250/pub/ResilientStorage
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# ScalableFileSystem
[ScalableFileSystem]
name=Instructor ScalableFileSystem Repository
baseurl=ftp://172.25.99.250/pub/ScalableFileSystem
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
2.安装
服务端:
yum install -y luci
[root@redhat5 ~]# /etc/init.d/luci start
Adding following auto-detected host IDs (IP addresses/domain names), corresponding to `redhat4.example.com' address, to the configuration of self-managed certificate `/var/lib/luci/etc/cacert.config' (you can change them by editing `/var/lib/luci/etc/cacert.config', removing the generated certificate `/var/lib/luci/certs/host.pem' and restarting luci):
(none suitable found, you can still do it manually as mentioned above)
Generating a 2048 bit RSA private key
writing new private key to '/var/lib/luci/certs/host.pem'
Starting saslauthd: [ OK ]
Start luci... [ OK ]
Point your web browser to https://redhat5.example.com:8084 (or equivalent) to access luci
[root@redhat5 ~]# chkconfig luci on
客户端:(redhat3 redhat4)
yum install -y ricci
[root@redhat3 ~]# /etc/init.d/ricci start
Starting system message bus: [ OK ]
Starting oddjobd: [ OK ]
generating SSL certificates... done
Generating NSS database... done
Starting ricci: [ OK ]
[root@redhat3 ~]# chkconfig ricci on
给ricci一个密码:
echo westos | passwd --stdin ricci
密码是redhat5的root密码
创建一个集群:
<下面应该写redhat3.example.com 和 redhat4.example.com,,截图>
如果有节点是红的(未加入集群的),肯定是缺少配置文件,就从正常的节点拷贝配置文件到没有加入集群的节点。
[root@foundation99 etc]# mkdir cluster
[root@foundation99 etc]# cd cluster/
[root@foundation99 cluster]# dd if=/dev/urandom of=/etc/cluster/fence_xvm.key bs=1024 count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.000234166 s, 4.4 MB/s
[root@foundation99 cluster]# ls
fence_xvm.key
把这个key拷贝到集群中的ricci节点:
[root@foundation99 cluster]# scp fence_xvm.key root@172.25.99.3:/etc/cluster/fence_xvm.key
使用fence
在server6上把server5 fence掉
就相当于把server5 断电然后重启。注意,-H后面接的是 virtual machine manager里面的名字。不一定是hostname
里面写server3 server4的uuid
实验结果:
如果:[root@redhat3 ~]# ifconfig eth0 down
那fence会把redhat 3关闭,然后重启。
如果:[root@redhat3 ~]# echo c > /proc/sysrq-trigger
内核会崩溃,redhat3也会关闭并重启。
配置文件会自动添加下面的行:
[root@redhat6 cluster]# ls
cluster.conf cman-notify.d fence_xvm.key
[root@redhat6 cluster]# cat cluster.conf
这些在配置文件/etc/cluster/cluster.conf 里面都会有的:
点上面这个 “Add Resource”添加刚才添加的resource. 一个IP 一个httpd
安装软件
1.都把yum源改成:
# repos on instructor for classroom use
# Main rhel6.5 server
[base]
name=Instructor Server Repository
baseurl=ftp://172.25.99.250/pub/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# HighAvailability rhel6.5
[HighAvailability]
name=Instructor HighAvailability Repository
baseurl=ftp://172.25.99.250/pub/HighAvailability
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# LoadBalancer packages
[LoadBalancer]
name=Instructor LoadBalancer Repository
baseurl=ftp://172.25.99.250/pub/LoadBalancer
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# ResilientStorage
[ResilientStorage]
name=Instructor ResilientStorage Repository
baseurl=ftp://172.25.99.250/pub/ResilientStorage
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# ScalableFileSystem
[ScalableFileSystem]
name=Instructor ScalableFileSystem Repository
baseurl=ftp://172.25.99.250/pub/ScalableFileSystem
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
2.安装
服务端:
yum install -y luci
[root@redhat5 ~]# /etc/init.d/luci start
Adding following auto-detected host IDs (IP addresses/domain names), corresponding to `redhat4.example.com' address, to the configuration of self-managed certificate `/var/lib/luci/etc/cacert.config' (you can change them by editing `/var/lib/luci/etc/cacert.config', removing the generated certificate `/var/lib/luci/certs/host.pem' and restarting luci):
(none suitable found, you can still do it manually as mentioned above)
Generating a 2048 bit RSA private key
writing new private key to '/var/lib/luci/certs/host.pem'
Starting saslauthd: [ OK ]
Start luci... [ OK ]
Point your web browser to https://redhat5.example.com:8084 (or equivalent) to access luci
[root@redhat5 ~]# chkconfig luci on
客户端:(redhat3 redhat4)
yum install -y ricci
[root@redhat3 ~]# /etc/init.d/ricci start
Starting system message bus: [ OK ]
Starting oddjobd: [ OK ]
generating SSL certificates... done
Generating NSS database... done
Starting ricci: [ OK ]
[root@redhat3 ~]# chkconfig ricci on
给ricci一个密码:
echo westos | passwd --stdin ricci
2创建集群
密码是redhat5的root密码
创建一个集群:
<下面应该写redhat3.example.com 和 redhat4.example.com,,截图>
如果有节点是红的(未加入集群的),肯定是缺少配置文件,就从正常的节点拷贝配置文件到没有加入集群的节点。
3配置fence
1.在真机foundation11上安装fence
<不装图形的话,就不会安装NetworkManager>2创建fence :
主要是修改一下br03.创建fence
_[root@foundation99 ~]# cd /etc/[root@foundation99 etc]# mkdir cluster
[root@foundation99 etc]# cd cluster/
[root@foundation99 cluster]# dd if=/dev/urandom of=/etc/cluster/fence_xvm.key bs=1024 count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.000234166 s, 4.4 MB/s
[root@foundation99 cluster]# ls
fence_xvm.key
把这个key拷贝到集群中的ricci节点:
[root@foundation99 cluster]# scp fence_xvm.key root@172.25.99.3:/etc/cluster/fence_xvm.key
4.启动fence
systemctl start fence_virtd.service在server6上把server5 fence掉
就相当于把server5 断电然后重启。注意,-H后面接的是 virtual machine manager里面的名字。不一定是hostname
里面写server3 server4的uuid
实验结果:
如果:[root@redhat3 ~]# ifconfig eth0 down
那fence会把redhat 3关闭,然后重启。
如果:[root@redhat3 ~]# echo c > /proc/sysrq-trigger
内核会崩溃,redhat3也会关闭并重启。
配置文件会自动添加下面的行:
[root@redhat6 cluster]# ls
cluster.conf cman-notify.d fence_xvm.key
[root@redhat6 cluster]# cat cluster.conf
4.在集群上配置http服务
1.添加Failover Domains
2.添加resources
这些在配置文件/etc/cluster/cluster.conf 里面都会有的:
3.添加Resource Groups
点上面这个 “Add Resource”添加刚才添加的resource. 一个IP 一个httpd
4.实验结果:
5在集群上部署iscsi
相关文章推荐
- Seafile Server本地权限提升漏洞(CVE-2014-5443)
- 从USB安装Ubuntu Server 10.04.3 图文详解
- 使用zabbix监控Nginx活动状态--Part1
- 高效访问Internet-启用ISA Server的缓存
- windows server域用户提升到本地更高权限组中的方法
- 批量自动安装常用软件
- 批量自动安装常用软件
- 企业批量部署RealVNC远程控制软件
- 好用的Markdown编辑器一览
- 完美解决SQL Server 安装问题:以前的某个程序安装已在安装计算机上创建挂起的文件操作
- IIS 错误 Server Application Error 详细解决方法
- 在WINXP系统上安装SQL Server企业版的方法
- SQL Server 存储过程的分页
- SQL Server复制需要有实际的服务器名称才能连接到服务器
- SQL Server 2000向SQL Server 2008 R2推送数据图文教程
- SQL server 表操作介绍
- SQL Server 2000 注入防护大全(二)
- SQL Server 2000 注入防护大全(一)
- 怎样把Windows server 2003转换成工作站系统