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 : ricci: ricci: ricci:
我这里已经配好了主机名了,但是其他的如时间同步,配置/etc/hosts/ 等都没执行,为了方便,所以写了个 playbook 来进行初始化一下
---
- hosts:hdpservers
remote_user: root
vars:
tasks:
- name: add synctime cron
cron: name='sync time' minute='*/5'job='/usr/sbin/ntpdate '
- name: shutdown iptables
service: name={
{}}state={
{}} enabled={
{}}
with_items:
- { name: iptables, state: stopped,enabled: no}
- { name: NetworkManager, state: stopped,enabled: no}
tags: stop service
- name: copy selinux conf file
copy: src={
{}} dest={
{}}owner={
{}} group={
{}} 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: cmd off selinux
shell: setenforce 0
执行这个 playbook,进行初始化
[root@cent1 yaml]#ansible-playbook
4.在 cent1 上安装 luci, luci 是一个 python 程序,依赖很多python包
[root@cent1 ~]#yum install luci
启动 luci
[root@cent3 ~]#/etc//luci start Adding followingauto-detected host IDs (IP addresses/domain names), corresponding to `cent3'address, to the configuration of self-managed certificate`/var/lib/luci/etc/' (you can change them by editing`/var/lib/luci/etc/', removing the generated certificate`/var/lib/luci/certs/' and restarting luci): (none suitable found, you can still doit manually as mentioned above) Generating a 2048bit RSA private key writing newprivate