[root@hadoop1 ~]# chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
[root@hadoop1 ~]# mv CDH-5.8.3-1.cdh5.8.3.p0.2-el7.parcel.sha1 CDH-5.8.3-1.cdh5.8.3.p0.2-el7.parcel.sha
[root@hadoop1 ~]# cp CDH-5.8.3-1.cdh5.8.3.p0.2-el7.parcel CDH-5.8.3-1.cdh5.8.3.p0.2-el7.parcel.sha manifest.json /opt/cloudera/parcel-repo
解释:Clouder-Manager将CDHs从主节点的/opt/cloudera/parcel-repo目录中抽取出来,分发解压激活到各个节点的/opt/cloudera/parcels目录中
初始脚本配置数据库scm_prepare_database.sh(在主节点上)
[root@hadoop1 ~]# /opt/cloudera-manager/cm-5.8.3/share/cmf/schema/scm_prepare_database.sh mysql -h hadoop1 -P 3306 -uroot -p --scm-host master scm scm scm
JAVA_HOME=/usr/java/jdk1.8.0_45
Verifying that we can write to /opt/cloudera-manager/cm-5.8.3/etc/cloudera-scm-server
Creating SCM configuration file in /opt/cloudera-manager/cm-5.8.3/etc/cloudera-scm-server
Executing: /usr/java/jdk1.8.0_45/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/Oracle-connector-java.jar:/opt/cloudera-manager/cm-5.8.3/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /opt/cloudera-manager/cm-5.8.3/etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
[ main] DbCommandExecutor INFO Successfully connected to database.
All done, your SCM database is configured correctly!
说明:这个脚本就是用来创建和配置CMS需要的数据库的脚本。各参数是指:
mysql:数据库用的是mysql,如果安装过程中用的oracle,那么该参数就应该改为oracle。
-hhadoop1:数据库建立在hadoop1主机上面。也就是主节点上面。
-uroot:root身份运行mysql。-123456:mysql的root密码是***。
--scm-host hadoop1:CMS的主机,一般是和mysql安装的主机是在同一个主机上。
最后三个参数是:数据库名,数据库用户名,数据库密码。
10.在各个节点启动agent服务
/opt/cloudera-manager/cm-5.8.3/etc/init.d/cloudera-scm-agent start
在master启动server服务
/opt/cloudera-manager/cm-5.8.3/etc/init.d/cloudera-scm-server start
浏览器访问
:7180/cmf/login 用户名admin 密码admin
问题1:
service cloudera-scm-server status
cloudera-scm-server dead but pid file exists
解决
[root@master cm-5.8.3]# rm /root/hadoop/cm-5.8.3/run/cloudera-scm-server.pid
[root@master hadoop]# ./cm-5.8.3/etc/init.d/cloudera-scm-server restart
cloudera-scm-server is already stopped
Starting cloudera-scm-server: [ OK ]
问题2:
2016-12-08 03:40:57,479 ERROR WebServerImpl:com.cloudera.server.web.cmf.search.components.SearchRepositoryManager: The server storage directory [/var/lib/cloudera-scm-server] doesn't exist.
2016-12-08 03:40:57,479 ERROR WebServerImpl:com.cloudera.server.web.cmf.search.components.SearchRepositoryManager: No read permission to the server storage directory [/var/lib/cloudera-scm-server]
2016-12-08 03:40:57,479 ERROR WebServerImpl:com.cloudera.server.web.cmf.search.components.SearchRepositoryManager: No write permission to the server storage directory [/var/lib/cloudera-scm-server]
解决:
创建目录并加上权限以后成功
mkdir /var/lib/cloudera-scm-server
chown -R cloudera-scm.cloudera-scm /var/lib/cloudera-scm-server
问题3:在CDH检查主机哪里会有两个警告
解决:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo 10 > /proc/sys/vm/swappiness