首先需要去MySql的官网下载JDBC驱动mysql-connector-java-5.1.38.tar.gz(可以下载最新的版本),下载地址: ,解压后找到mysql-connector-java-5.1.38-bin.jar放到/opt/cm-5.7.2/share/cmf/lib/中: cp mysql-connector-java-5.1.38-bin.jar /opt/cm-5.7.2/share/cmf/lib/
/opt/cm-5.7.2/share/cmf/schema/scm_prepare_database.sh mysql cm -h dcnn1 -uroot -pbigdata --scm-host dcnn1 scm scm scm
遇到问题:未解决,但不影响后面得部署
AVA_HOME=/usr/java/jdk1.8.0_60
Verifying that we can write to /opt/cm-5.7.2/etc/cloudera-scm-server
log4j:ERROR Could not find value for key log4j.appender.A
log4j:ERROR Could not instantiate appender named "A".
Creating SCM configuration file in /opt/cm-5.7.2/etc/cloudera-scm-server
Executing: /usr/java/jdk1.8.0_60/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/opt/cm-5.7.2/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /opt/cm-5.7.2/etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
log4j:ERROR Could not find value for key log4j.appender.A
log4j:ERROR Could not instantiate appender named "A".
agent配置
1)修改/opt/cm-5.7.2/etc/cloudera-scm-agent/config.ini中的server_host, server_host为主节点的主机名
2)同步Agent到其他节点
sudo scp -r /opt/cm-5.7.2 root@dcnn2:/opt/;
sudo scp -r /opt/cm-5.7.2 root@dcdn01:/opt/;
sudo scp -r /opt/cm-5.7.2 root@dcdn02:/opt/;
sudo scp -r /opt/cm-5.7.2 root@dcdn03:/opt/;
2.10启动服务
通过sudo /opt/cm-5.7.2/etc/init.d/cloudera-scm-server start 启动服务端
通过sudo /opt/cm-5.7.2/etc/init.d/cloudera-scm-agent start 启动agent端
我们启动的其实是个service脚本,需要停止服务将以上的start参数改为stop就可以了,重启是restart。
2.11 通过cm部署CDH
1)登录:7180
2)根据向导就可以一步一步进行了,比较简单。
3 遇到问题
1、hive和oozie启动失败
缺少JDBC驱动,因为我的mysql装在远端,这里要访问的时候要通过JDBC驱动。因此将mysql-connector-java-5.1.22-bin.jar添加到hive和oozie的lib:
sudo cp mysql-connector-java-5.1.38-bin.jar /opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/lib/hive/lib
sudo cp mysql-connector-java-5.1.38-bin.jar /opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/lib/oozie/libext
2、安装后hive在查询时失败,原因是权限问题