zoukankan      html  css  js  c++  java
  • KVM环境搭建RHCS

    一、环境
     
    Hypervisor:RHEL 6.3                 
                 IP:10.10.60.10    login:root    passwd:root
     
    Guest OS  :CentOS 6.3   两台
                 node1   IP:10.10.60.16   login:root   passwd:root
                 node2   IP:10.10.60.55   login:root   passwd:root
     
    二、配置
     
    1、修改hosts文件
    # cat /etc/hosts
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    10.10.60.16 node1
    10.10.60.55 node2
     
    2、同步ssh key
    [root@node1 ~]# scp -r /root/.ssh/ node2:/root/
     
    3、安装RHCS套件
    # for i in cman ricci ;do rpm -qa | grep $i;done
    cman-3.0.12.1-32.el6.x86_64
    ricci-0.16.2-55.el6.x86_64
     
    4、测试Hypervisor的libvirt连接情况

    [root@node1 ~]# virsh -c qemu+ssh://10.10.60.10/system
    root@10.10.60.10's password: 
    Welcome to virsh, the virtualization interactive terminal.

    Type:  'help' for help with commands
           'quit' to quit

    virsh # list
    Id    Name                           State
    ----------------------------------------------------
    2     cLient_App                     running
    14    node1                          running
    18    node2                          running

    virsh #
    出现虚机信息,说明libvirt连接成功,可用于fence
     
    5、编辑cluster.conf文件(记得同步到node2)
     
    [root@node1 ~]# cat /etc/cluster/cluster.conf
    <?xml version="1.0"?>
    <cluster config_version="12" name="kvm_fence">
         <clusternodes>
              <clusternode name="node1" nodeid="1">
                   <fence>
                        <method name="virsh">
                             <device action="reboot" name="virsh" port="node1"/>
                        </method>
                   </fence>
              </clusternode>
              <clusternode name="node2" nodeid="2">
                   <fence>
                        <method name="virsh">
                             <device action="reboot" name="virsh" port="node2"/>
                        </method>
                   </fence>
              </clusternode>
         </clusternodes>
         <cman expected_votes="1" two_node="1"/>
         <fencedevices>
              <fencedevice agent="fence_virsh" ipaddr="10.10.60.10" login="root" name="virsh" passwd="root"/>
         </fencedevices>
    </cluster>

    验证cluster.conf语句
    [root@node1 ~]# ccs_config_validate
    Configuration validates
     
    备注:cluster.conf文件中fencedevice agent部分参数由man fence_virsh可知
     
     
    6、测试节点手动fence
     
    [root@node1 ~]# fence_virsh --ip=10.10.60.10 --username=root --password=root  -x -n node2
    Success: Rebooted

    或者

    [root@node1 ~]# fence_node node2
    fence node2 success

    fence_node命令会自动取fence_virsh中相关参数
     
     
    7、服务开机启动
    # chkconfig cman on
    # chkconfig ricci on
  • 相关阅读:
    图像、视频等文件类型(拓展名)
    图像、视频等文件类型(拓展名)
    Mstar 编译器的搭建
    microsoft windows network 不允许一个用户使用一个以上用户名与服务器或共享资源的多重连接
    Ubuntu 14.04报“leaking memory”错误
    linux下创建与删除用户详细步骤 ***
    GX 编译器 的搭建
    VMware网络模式介绍
    ubuntu 源更新(sources.list)
    目录的执行权限
  • 原文地址:https://www.cnblogs.com/tonychiu/p/5766537.html
Copyright © 2011-2022 走看看