CDH:cdh5环境搭建

安装环境三台centos7 vmw:

cdh-141 192.168.0.141    [主节点]
cdh-142 192.168.0.142    [从节点]
cdh-143 192.168.0.143    [从节点]

1)[各节点]使用本地yum repo进行安装时:

需要在各个节点(192.168.0.141,192.168.0.142,192.168.0.143)上设置本地repo(/etc/yum.repos.d/)

cd /etc/yum.repos.d/
mkdir backup
mv *.repo ./backup
echo '[cloudera-manager]
name = Cloudera Manager, Version 5.13.0
baseurl = http://192.168.0.141/cm5/
gpgcheck = 0
'> cloudera-manager.repo

echo '[myrepo]
name=myrepo
baseurl=http://192.168.0.141/cm5/
enabled=1
gpgcheck=0'> myrepo.repo

2)[主节点]需要安装httpd,并在/var/www/html下创建cm5存放cm安装源

从http://archive.cloudera.com/cm5/redhat/7/x86_64/cm/5.13.0/下载源文件到该(/var/wwww/html/cm5)路径下;

[root@cdh-141 bin]$ cd /var/www/html/
[root@cdh-141 html]$ ls
cdh5 cm5
[root@cdh-141 html]$ cd cm5/
[root@cdh-141 cm5]$ ls
mirror repodata RPMS

3)[主节点]需要下载cdh5的安装源

(
http://archive.cloudera.com/cdh5/parcels/5.13.0/CDH-5.13.0-1.cdh5.13.0.p0.29-el7.parcel
http://archive.cloudera.com/cdh5/parcels/5.13.0/CDH-5.13.0-1.cdh5.13.0.p0.29-el7.parcel.sha1
http://archive.cloudera.com/cdh5/parcels/5.13.0/manifest.json
)到/val/www/html/cdh5/下

[root@cdh-141 ~]$ cd /var/www/html/
[root@cdh-141 html]$ ls
cdh5 cm5
[root@cdh-141 html]$ cd cdh5/
[root@cdh-141 cdh5]$ ls
CDH-5.13.0-1.cdh5.13.0.p0.29-el7.parcel CDH-5.13.0-1.cdh5.13.0.p0.29-el7.parcel.sha manifest.json

输入地址:http://192.168.0.141:7180,进行安装过程中出现错误:

问题解决:安装Cloudera manager agent失败

安装过程中出现警告解决方案参考:http://www.cnblogs.com/fujiangong/p/5620050.html

 

Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: python-psycopg2
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: psmisc
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: MySQL-python
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: bind-utils
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: /lib/lsb/init-functions
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: cyrus-sasl-plain
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: portmap
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: cyrus-sasl-gssapi
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: mod_ssl
Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager)
Requires: openssl-devel

解决方案:

yum clean all
yum mackecache

yum -y install httpd python-psycopg2 psmisc MySQL-python bind-utils init-functions cyrus-sasl-plain portmap cyrus-sasl-gssapi mod_ssl openssl-devel

#Error: Package: cloudera-manager-agent-5.15.1-1.cm5151.p0.3.el7.x86_64 (cloudera-manager) 
#Requires: /lib/lsb/init-functions 
yum install lsb

问题解决:不良 : 群集中有 710 个 副本不足的块 块。群集中共有 710 个块。百分比 副本不足的块: 100.00%。 临界阈值:40.00%。

 将hdfs复制因子修改为2,默认3,而我这datanode只有两个,因此不够三个复制因子。

 

然后在master(CDH-141)中通过命令更改备份数:

su  hdfs
hadoop fs -setrep -R 2 /

#这里的-R 2的数字2就对应我们的DataNode个数。

修改成功后,重启hdfs,出现:不良 : Canary 测试无法在目录 /tmp/.cloudera_health_monitoring_canary_files 中创建文件。

经过查看日志,发现 Name node is in safe mode. 
解决方法:

sudo -u hdfs hdfs dfsadmin -safemode leave

问题解决:Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

运行

[root@cdh-141 bin]# pwd
/opt/cloudera/parcels/SPARK2/bin
[root@cdh-141 bin]# spark2-shell 

出现异常:Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

解决方案

1.修改hdfs参数  dfs.permissions=false,赋权限给root

2.重启HDFS组件,让其生效。 

3.重启成功后,shell重新登录,root执行也ok

不让其进行权限验证,

 

重新安装时,可以以下命令删除:

如果安装过程中出现失败,需要重新安装时,可以以下命令删除:

/usr/share/cmf/uninstall-cloudera-manager.sh 
service cloudera-scm-agent stop
service cloudera-scm-agent stop
umount /var/run/cloudera-scm-agent/process
umount /var/run/cloudera-scm-agent/process
umount /var/run/cloudera-scm-agent/process

rm -rf /usr/share/cmf /var/lib/cloudera* /var/cache/yum/x86_64/6/cloudera* /var/log/cloudera* /var/run/cloudera*  /etc/cloudera* 


rpm -qa | grep cloudera
for f in `rpm -qa | grep cloudera `  ; do rpm -e ${f} ; done

rm -rf /var/lib/hadoop-* /var/lib/impala /var/lib/solr /var/lib/zookeeper /var/lib/hue /var/lib/oozie  /var/lib/pgsql  /var/lib/sqoop2  /data/dfs/  /data/impala/ /data/yarn/  /dfs/ /impala/ /yarn/  /var/run/hadoop-*/ /var/run/hdfs-*/ /usr/bin/hadoop* /usr/bin/zookeeper* /usr/bin/hbase* /usr/bin/hive* /usr/bin/hdfs /usr/bin/mapred /usr/bin/yarn /usr/bin/sqoop* /usr/bin/oozie /etc/hadoop* /etc/zookeeper* /etc/hive* /etc/hue /etc/impala /etc/sqoop* /etc/oozie /etc/hbase* /etc/hcatalog 

rm -rf ` find /var/lib/alternatives/* ! -name "mta" ! -name "print" ! -name "zlibrary-ui"  -mtime -3` 
rm -rf /etc/alternatives/* 
for u in hdfs mapred cloudera-scm hbase hue zookeeper oozie hive impala flume; do sudo kill $(ps -u $u -o pid=); done
rm -rf /opt/cloudera/parcel-cache /opt/cloudera/parcels

 

posted @ 2018-11-15 10:36  cctext  阅读(3009)  评论(0编辑  收藏  举报