CentOS 6.6使用 luci/ricci 安装配置 RHCS 集群
1.配置RHCS集群的前提:
时间同步
名称解析,这里使用修改/etc/hosts文件
配置好yum源,CentOS 6的默认的就行
关闭防火墙(或者开放集群所需通信端口),和selinux,
关闭NetworkManager服务
2. RHCS所需要的主要软件包为cman和rgmanager
cman:是集群基础信息层,在CentOS 6中依赖corosync
rgmanager:是集群资源管理器,类似于pacemaker的功能
luci:提供了管理rhcs集群的web界面, luci管理集群主要是通过跟ricci通信来完成的。
ricci:安装在集群的节点的接收来自luci管理请求的代理。
luci跟ricci的关系就好像ambari-server跟ambari-agent一样。
3.环境说明:
luci:192.168.6.31cent1.test.comricci:192.168.6.32cent2.test.comricci:192.168.6.33cent3.test.comricci:192.168.6.34cent4.test.com我这里已经配好了主机名了,但是其他的如时间同步,配置/etc/hosts/等都没执行,为了方便,所以写了个playbook来进行初始化一下
----hosts:hdpserversremote_user:rootvars:tasks:-name:addsynctimecroncron:name='synctime'minute='*/5'job='/usr/sbin/ntpdate192.168.6.31'-name:shutdowniptablesservice:name={{item.name}}state={{item.state}}enabled={{item.enabled}}with_items:-{name:iptables,state:stopped,enabled:no}-{name:NetworkManager,state:stopped,enabled:no}tags:stopservice-name:copyselinuxconffilecopy:src={{item.src}}dest={{item.dest}}owner={{item.owner}}group={{item.group}}mode={{item.mode}}with_items:-{src=\'#\'" /etc/selinux/config',dest:/etc/selinux/config,owner:root,group:root,mode:'0644'}-{src=\'#\'" /etc/hosts',dest:/etc/hosts,owner:root,group:root,mode:'0644'}-name:cmdoffselinuxshell:setenforce0执行这个 playbook,进行初始化
[root@cent1yaml]#ansible-playbookbase.yml4.在cent1上安装luci, luci是一个python程序,依赖很多python包
[root@cent1~]#yuminstallluci启动luci
[root@cent3~]#/etc/init.d/lucistartAddingfollowingauto-detectedhostIDs(IPaddresses/domainnames),correspondingto`cent3'address,totheconfigurationofself-managedcertificate`/var/lib/luci/etc/cacert.config'(youcanchangethembyediting`/var/lib/luci/etc/cacert.config',removingthegeneratedcertificate`/var/lib/luci/certs/host.pem'andrestartingluci):(nonesuitablefound,youcanstilldoitmanuallyasmentionedabove)Generatinga2048bitRSAprivatekeywritingnewprivatekeyto'/var/lib/luci/certs/host.pem'正在启动saslauthd:[确定]Startluci...[确定]Pointyourwebbrowsertohttps://cent1.hfln.com:8084(orequivalent)toaccessluci现在可以在前台登录luci了,看清是https哦

账号密码就是这台主机的账号和密码

登录成功啦,现在来配置rhcs的集群,这个只是用来管理集群的,真正的集群还没开始装呢。
5.在cnet2, cent3, cent4中安装ricci, ricci也依赖很多软件,这里使用ansible直接在三个节点上装,当然我已经配好了cent1到其他节点的免密钥登录了
[root@cent1~]#ansiblerhcs-myum-a"name=ricci"装好ricci之后还要在node节点上给ricci

