标签:centos6.5 时钟 关闭防火墙 sel 删掉 方法 使用 settime public
共三台机器
操作系统: centos6.5
机器名:work01、work02、work03
work03执行Cloudera Manager
生产环境假设要做为在线服务还是须要。
1.1 关闭防火墙:
service iptables stop (暂时关闭)
chkconfig iptables off(重新启动后生效)
1.2 关闭SELINUX:
setenforce 0 (暂时生效)(这种方法我没有执行成功)
改动 /etc/selinux/config 下的 SELINUX=disabled (重新启动后永久生效 )该方法測试有效。
查看selinux状态:/usr/sbin/sestatus -v
注意:三台机器都须要进行同样操作
a. 三台机器都须要进行同样操作
b./etc/sysconfig/network 配置相应的主机名
c./etc/hosts 三台机器内容同样,来实现三台机器相互能够通过主机名訪问
d. 假设机器较多能够通过配置DNSserver来解析主机名
1)改动/etc/sysconfig/network文件
NETWORKING=yes
HOSTNAME=work01
2)改动/etc/hosts文件
192.168.1.185 work01 work01
192.168.1.141 work02 work02
192.168.1.198 work03 work03
3)重新启动网络服务后生效:service network restart
測试中重新启动网络服务会断网,并且不会自己主动连接。须要点击一下连接图标才干再次连接,请慎重操作
说明:
a. 机器之间会通过ssh拷贝一些文件,发送一些服务启动命令,建立集群间的无passwordssh登录,不用你每次启动服务都输入一大堆password了。
b. 貌似Cloudera Manager已经管理登录password了。这一步可能能够跳过,感兴趣的能够试试。
c. ssh无password登录原理是生成一对公钥和密钥,把公钥给别人。别人就可有无password訪问自己了。比方A把生成的公钥给B那B就能够无password訪问A了。
d.生成的公钥为id_rsa.pub,将要訪问的机器公钥保存在authorized_keys文件里
e.为了保存多台机器的公钥,以追加的方式加入到authorized_keys中
1)work01机器上切换root帐号
su
2)生成root帐号在work01上的密钥和公钥
ssh-keygen -t rsa
一路回车下去生成公钥id_rsa.pub和密钥id_rsa
3)生成root帐号在work02、work03上的密钥和公钥
4)将work02和work03上的公钥文件复制到work01上
[root@work02 ~]#scp ~/.ssh/id_rsa.pub root@work01:~/.ssh/work02.pub
[root@work03 ~]# scp ~/.ssh/id_rsa.pub root@work01:~/.ssh/work03.pub
拷贝时注意区分文件名称
5)将work01、work02和work03三台机器的公钥都增加work01的authorized_keys文件里
catid_rsa.pub >>authorized_keys
cat work02.pub >>authorized_keys
catwork03.pub >>authorized_keys
6)将work01上的authorized_keys文件复制到work02、work03上
[root@work01 ~]# scp ~/.sshauthorized_keys root@work02:~/.ssh/
[root@work01 ~]# scp ~/.sshauthorized_keys root@work03:~/.ssh/
注意:无password登录仅仅对生成公钥的帐号有效。注意这里产生公钥的帐号要与之后须要远程启动服务的帐号一致
1)进入yum源配置文件夹
cd /etc/yum.repos.d
2)备份系统自带的yum源
mv CentOS-Base.repo CentOS-Base.repo.bk
3)下载163的yum源:
wget http://mirrors.163.com/.help/CentOS-Base-163.repo
mv CentOS6-Base-163.repo CentOS-Base.repo
3)更新完yum源后,运行下边命令更新yum配置,使操作马上生效
yum makecache
yum clean all
下载链接:http://archive.cloudera.com/cdh5/parcels/latest/
说明:
a. Cloudera Manager的安装文件会自己主动下载所须要的rpm文件。可是因为这些文件的yum源在国外所以安装过程非常慢,因此这里通过手动下载这些rpm文件来提高下载速度。
b. 须要先执行Cloudera Manager的安装文件得到须要的rpm文件的地址
6.1下载cloudera Manager 安装文件
chmod u+x cloudera-manager-installer.bin
./cloudera-manager-installer.bin
6.3 得到须要安装的rmp文件的下载地址
1)进入 yum 源文件夹
cd /etc/yum.repos.d
2)查看cloudera-manager yum 源文件是否已经下载下来
多了一个 cloudera-manager.repo 文件
3)得到rpm下载地址
cat cloudera-manager.repo
当中rpm下载地址为:baseurl=http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5/
6.4 关闭Cloudera Manager安装向导
1)关闭 cloudera-manager-installer.bin
2)杀掉 Cloudera Manager安装向导 启动的yum进程
ps aux|grep yum(得到cm安装向导启动的yum的进程号)
kill xxxx (按进程号杀掉对应进程)
6.5 手动下载对应的rpm文件(一共7个文件)
Name
Last modified
Size
Description
-
11-Jun-2014 18:09
3.7M
cloudera-manager-daemons-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
11-Jun-2014 18:09
315M
11-Jun-2014 18:09
8.0K
cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
11-Jun-2014 18:09
9.6K
11-Jun-2014 18:09
669K
11-Jun-2014 18:09
68M
11-Jun-2014 18:09
131M
6.6 手动安装下载的 rpm文件yum localinstall --nogpgcheck *.rpm
6.7 再次执行Cloudera Manager安装文件
执行中出现了两个错误,各自是:
1)问题描写叙述:fatal erro
解决方法:rm -rf /usr/share/cmf/
2)问题描写叙述:Installation failed. Failed to start Embedded Service and Configuration Database,See vim /var/log/cloudera-manager-installer/5.start-embedded-db.log for details.
bash: /usr/share/cmf/bin/initialize_embedded_db.sh: No such file or directory
解决方法:重新启动安装向导错误没有复现
说明:
a. 使用Cloudera Manager安装CDH 也有两种方式,一种是使用rpm包,还有一种是使用parcels包,本測试使用parcels包
b. Cloudera Manager 会自己主动下载须要的parcels包,可是由于连接的是国外网站速度会非常慢
c. 配置第5步下载的CDH parcels文件能够使Cloudera Manager直接读取本地的parcels文件
7.1 将前面下载的CDH parcels文件放到 /opt/cloudera/parcel-repo 文件夹下
7.2 生成相应的sha文件
1)在第5步下载的 manifest.json 文件里依照版本号“CDH-5.1.0-1.cdh5.1.0.p0.53-el6.parcel”找到相应的 hash值
"hash": "67fc4c86b260eeba15c339f1ec6be3b59b4ebe30"
2)hash值保存在sha文件里
echo ‘67fc4c86b260eeba15c339f1ec6be3b59b4ebe30‘>CDH-5.1.0-1.cdh5.1.0.p0.53-el6.parcel.sha
安装中出现例如以下问题,详细解决方案见 “问题列表” 问题1:
python -c ‘import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect(("localhost", int(7182))); s.close();‘
说明:尽量把全部的參考文档都列了出来,假设有遗漏欢迎提醒。Cloudera Manager 和CDH 4 终极安装http://www.tuicool.com/articles/AnuiUra
C?l?o?u?d?e?r?a?M?a?n?a?g?e?r?和?C?D?H?4?安?装:http://wenku.baidu.com/link?
CDH套件半手动安装流程http://www.douban.com/note/352772895/
使用yum安装CDH Hadoop集群(cdh5 禁用ipv6、hostname设置、设置yum源、时钟同步): http://blog.javachen.com/2013/04/06/install-cloudera-cdh-by-yum/
查看 SELinux状态及关闭SELinux:http://bguncle.blog.51cto.com/3184079/957315
CentOS6.5中改动yum源:http://www.cnblogs.com/liuling/p/2014-4-14-001.html
描写叙述:
DNS反向解析错误,不能正确解析Cloudera Manager Server主机名
日志:
Detecting Cloudera Manager Server...
Detecting Cloudera Manager Server...
BEGIN host -t PTR 192.168.1.198
198.1.168.192.in-addr.arpa domain name pointer localhost.
END (0)
using localhost as scm server hostname
BEGIN which python
/usr/bin/python
END (0)
BEGIN python -c ‘import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect((sys.argv[1], int(sys.argv[2]))); s.close();‘ localhost 7182
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 1, in connect
socket.error: [Errno 111] Connection refused
END (1)
could not contact scm server at localhost:7182, giving up
waiting for rollback request
不优雅的解决方式:
将连不上的机器 /usr/bin/host 文件删掉
BEGIN host -t PTR 192.168.1.198
/tmp/scm_prepare_node.8OX5y7is/scm_prepare_node.sh: line 100: /usr/bin/host: 权限不够
END (126)
BEGIN which python
/usr/bin/python
END (0)
BEGIN python -c ‘import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect((sys.argv[1], int(sys.argv[2]))); s.close();‘ 192.168.1.198 7182
END (0)
BEGIN which wget
/usr/bin/wget
END (0)
BEGIN wget -qO- -T 1 -t 1 http://169.254.169.254/latest/meta-data/public-hostname && /bin/echo
END (4)
说明:
不明确cloudera的初衷,这里已经得到 Cloudera Manager Server的ip了,却还要把ip解析成主机名来连接
因为DNS反向解析没有配置好。依据Cloudera Manager Server 的ip解析主机名却得到了localhost,造成之后的连接错误
这里的解决方式是直接把/usr/bin/host删掉,这样Cloudera Manager就会直接使用 ip进行连接,就没有错了
參考:
cloudera manager 4.8 加入设备DNS反向解析有关问题
http://www.reader8.cn/jiaocheng/20140419/2307406.html
问题 2.1
问题描写叙述:
Bad Health --Clock Offset
The host‘s NTP service did not respond to a request for the clock offset.
解决:
配置NTP服务
步骤參考:
CentOS配置NTP Server:
http://www.hailiangchen.com/centos-ntp/
国内经常使用NTPserver地址及IP
http://www.douban.com/note/171309770/
改动配置文件:
[root@work03 ~]# vim /etc/ntp.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server s1a.time.edu.cn prefer
server s1b.time.edu.cn
server s1c.time.edu.cn
restrict 172.16.1.0 mask 255.255.255.0 nomodify <===放行局域网来源
启动ntp
#service ntpd restart <===启动ntp服务
client同步时间(work02,work03):
ntpdate work01
说明:NTP服务启动须要大约五分钟时间,服务启动之前,若client同步时间,则会出现错误“no server suitable for synchronization found”
定时同步时间:
在work02和 work03上配置crontab定时同步时间
crontab -e
00 12 * * * root /usr/sbin/ntpdate 192.168.56.121 >> /root/ntpdate.log 2>&1
问题 2.2
描写叙述:
Clock Offset
- Ensure that the host‘s hostname is configured properly.
- Ensure that port 7182 is accessible on the Cloudera Manager Server (check firewall rules).
- Ensure that ports 9000 and 9001 are free on the host being added.
- Check agent logs in /var/log/cloudera-scm-agent/ on the host being added (some of the logs can be found in the installation details).
问题定位:
解决:
在相应host(work02、work03)上执行 ‘ntpdc -c loopinfo‘
[root@work03 work]# ntpdc -c loopinfo
ntpdc: read: Connection refused
开启ntp服务:
三台机器都开机启动 ntp服务
chkconfig ntpd on
错误信息:
Installation failed. Failed to receive heartbeat from agent.
解决:关闭防火墙
Unknow Health
重新启动后:Request to theHost Monitor failed.
service --status-all| grep clo
机器上查看scm-agent状态:cloudera-scm-agent dead but pid file exists
解决:重新启动服务
service cloudera-scm-agent restartservice cloudera-scm-server restart
Bad Health
The hostname and canonical name for this host are not consistent when checked from a Java process.
canonical name:
4092 Monitor-HostMonitor throttling_logger WARNING (29 skipped) hostname work02 differs from the canonical name work02.xinzhitang.com
解决:改动hosts 使FQDN和 hostname同样
ps:尽管攻克了可是不明确为什么主机名和主机别名要一样
/etc/hosts
192.168.1.185 work01 work01
192.168.1.141 work02 work02
192.168.1.198 work03 work03
Concerning Health Issue
-- Network Interface Speed --
描写叙述:The host has 2 network interface(s) that appear to be operating at less than full speed. Warning threshold: any.
具体:
This is a host health test that checks for network interfaces that appear to be operating at less than full speed.
A failure of this health test may indicate that network interface(s) may be configured incorrectly and may be causing performance problems. Use the ethtool command to check and configure the host‘s network interfaces to use the fastest available link speed and duplex mode.
解决:
本次測试改动了 Cloudera Manager 的配置。应该不算是真正的解决
标签:centos6.5 时钟 关闭防火墙 sel 删掉 方法 使用 settime public
原文地址:http://www.cnblogs.com/lxjshuju/p/6941283.html