3. Cloudera-Manager安装
3.1 下载第三方依赖包
最后一步安装第三方依赖包的时候,主要针对的是centos,公司中还是要看使用的linux发行版缺少那些版本;
yum install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb -y
3.2 安装配置cm
1) 在http://archive.cloudera.com/cm5/cm/5/下载:cloudera-manager-centos7-cm5.12.2_x86_64.tar.gz
2) 创建/opt/cloudera-manager目录,上传并将tar包解压到该目录下
3) 创建用户scm
useradd --system --home=/opt/cloudera-manager/cm-5.12.2/run/cloudera-scm-server --no-create-home --comment "Cloudera SCM User" scm
4) 修改拥有者用户
chown -R scm:scm /opt/cloudera-manager
3.3 安装配置parcels
1) cloudera-cdh5 parcels下载地址: http://archive.cloudera.com/cdh5/parcels/5.12.2.4/
下载el为最新的三个文件
CDH-5.12.2-1.cdh5.12.2.p0.4-el7.parcel
CDH-5.12.2-1.cdh5.12.2.p0.4-el7.parcel.sha1
manifest.json
2) 按照官网的文件格式下载源文件, 上传到linux.
目录为/opt/cloudera/parcel-repo,文件夹拥有者要改为scm:
chown -R scm:scm /opt/cloudera
3) 修改sha1为sha:
mv CDH-5.12.2.cdh5.12.2.p0.4-el7.parcel.sha1 CDH-5.12.2.cdh5.12.2.p0.4-el7.parcel.sha
3.4 登录mysql的scm用户,创建需要Cloudera-Manager各个组件存储元数据的数据库
mysql> create database hive DEFAULT CHARACTER SET utf8;
mysql> create database hue DEFAULT CHARACTER SET utf8;
mysql> create database monitor DEFAULT CHARACTER SET utf8;
mysql> create database oozie DEFAULT CHARACTER SET utf8;
mysql> create database reports DEFAULT CHARACTER SET utf8;
mysql> flush privileges;
3.5 mysql客户端驱动
1) 下载http://dev.mysql.com/downloads/connector/j/5.1.html
2) 上传mysql-connector-java-5.1.46.tar.gz到/opt/mysql中
3) 复制4份mysql驱动(重点)
cm
cp mysql-connector-java-5.1.46-bin.jar /opt/cloudera-manager/cm-5.12.2/share/cmf/lib/
java
cp mysql-connector-java-5.1.46-bin.jar /usr/share/java/mysql-connector-java.jar
hive
cp mysql-connector-java-5.1.46-bin.jar /opt/cloudera/parcels/CDH-5.12.2-1.cdh5.12.2.p0.4/lib/hive/lib
oozie
cp mysql-connector-java-5.1.46-bin.jar /opt/cloudera/parcels/CDH-5.12.2-1.cdh5.12.2.p0.4/lib/oozie/libtools
3.6 使用scm_prepare_database.sh创建cm数据库,也可登录mysql用SQL脚本创建
/opt/cm-5.12.2/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -p111111 --scm-host localhost scm scm scm
注:输出一下内容,说明成功:
…
Executing: /opt/jdk1.8.0_60/bin/java -cp/usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/opt/cloudera-manager/cm-5.7.3/share/cmf/schema/.
./lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /opt/cloudera-manager/cm-5.7.0/etc/cloudera-scm-server/db.propertiescom.cloudera.cmf.db.[main] DbCommandExecutor INFOSuccessfullyconnected to database.
All done,your SCM database is configured correctly!
3.7 Cloudera agent安装
修改config.ini的server_host=hadoop1,主节点
vi /opt/cloudera-manager/cm-5.12.2/etc/cloudera-scm-agent/config.ini
将/opt下配置好的cloudear-manager和下载好的cloudera分发到各个节点
scp -r /opt/cloudera root@hadoop2:/opt/
scp -r /opt/cloudera root@hadoop3:/opt/
scp -r /opt/cloudera-manager root@hadoop2:/opt/
scp -r /opt/cloudera-manager root@hadoop3:/opt/
在另外两个节点(hadoop2~3)中创建scm用户,并赋予/opt里两个文件夹的权限
useradd --system--home=/opt/cloudera-manager/cm-5.12.2/run/cloudera-scm-server --no-create-home --comment "Cloudera SCM User" cloudera-scm
chown -R cloudera-scm:cloudera-scm /opt/cloudera-manager
chown -R cloudera-scm:cloudera-scm /opt/cloudera
3.8 Cloudera server启动
/opt/cloudera-manager/cm-5.12.2/etc/init.d/cloudera-scm-server start
tail -f /opt/cloudera-manager/cm-5.12.2/log/cloudera-scm-server/cloudera-scm-server.log
注:server端在初始化,看日志知道出现以下字样表明初始化完成:
。。。
2016-03-23 11:17:50,333 INFOWebServerImpl:org.mortbay.log: jetty-6.1.26.cloudera.4
2016-03-23 11:17:50,334 INFOWebServerImpl:org.mortbay.log: Started [email protected]:7180
2016-03-23 11:17:50,334 INFOWebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
Cloudera server启动需约一分钟时间,等待一会,执行以下代码,查看server是否正常运行
/opt/cloudera-manager/cm-5.12.2/etc/init.d/cloudera-scm-server status
如果没有问题,启动agent服务
/opt/cloudera-manager/cm-5.12.2/etc/init.d/cloudera-scm-agent start
接下来hadoop2~3节点只启动agent服务
3.9 访问Cloudera管理台WEB
浏览器输入:
hadoop1:7180
默认:
用户:admin
密码:admin
出现登录界面则表示cm安装成功
3.11 hadoop1~3节点全部受管理,即为正常启动。