CM安装部署

2021-03-23 14:25:46 浏览数 (1)

CM安装部署

注:以下所有操作均使用root用户

1 解压cloudera-manager-el6-cm5.12.1_x86_64.tar.gz

[root@hadoop102 module]# mkdir /opt/module/cloudera-manager

[root@hadoop102 module]# tar -zxvf /opt/software/cloudera-manager-el6-cm5.12.1_x86_64.tar.gz -C /opt/module/cloudera-manager/

2 创建用户cloudera-scm(所有节点)

[root@hadoop102 cloudera-scm-server]# useradd –system –home=/opt/module/cloudera-manager/cm-5.12.1/run/cloudera-scm-server –no-create-home –shell=/bin/false –comment “Cloudera SCM User” cloudera-scm

–system 创建一个系统账户

–home 指定用户登入时的主目录,替换系统默认值/home/<用户名>

–no-create-home 不要创建用户的主目录

–shell 用户的登录 shell 名

–comment 用户的描述信息

注意:

Cloudera Manager默认用户为cloudera-scm,创建具有此名称的用户是最简单的方法。 安装完成后,将自动使用此用户。

3 配置CM Agent

修改文件/opt/module/cloudera-manager/cm-5.12.1/etc/cloudera-scm-agent/ config.ini

[root@hadoop102 cloudera-scm-agent]# vim /opt/module/cloudera-manager/cm-5.12.1/etc/cloudera-scm-agent/config.ini

server_host=hadoop102

4 配置CM的数据库

  1. 拷贝mysql jar文件到目录 /usr/share/java/

[root@hadoop102 share]# mkdir /usr/share/java/

[root@hadoop102 cm-5.12.1]# cp /opt/software/mysql-libs/mysql-connector-java-5.1.27/mysql-connector-java-5.1.27-bin.jar /usr/share/java/

[root@hadoop102 share]# mv /usr/share/java/mysql-connector-java-5.1.27-bin.jar /usr/share/java/mysql-connector-java.jar

• 注意jar包名称要修改为mysql-connector-java.jar 在mysql中创建cm库

[root@hadoop102 cm-5.12.1]# /opt/module/cloudera-manager/cm-5.12.1/share/cmf/schema/scm_prepare_database.sh mysql cm -hhadoop102 -uroot -p000000 –scm-host hadoop102 scm scm scm

-h:Database host

-u:Database username

-p:Database Password

–scm-host:SCM server’s hostname

5 分发cloudera-manager

[root@hadoop102 module]# scp -r /opt/module/cloudera-manager/ hadoop103:/opt/module/

[root@hadoop102 module]# scp -r /opt/module/cloudera-manager/ hadoop104:/opt/module/

6 创建Parcel-repo 目录

1. Servre 节点创建目录/opt/cloudera/parcel-repo

[root@hadoop102 module]# mkdir -p /opt/cloudera/parcel-repo

[root@hadoop102 module]# chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo

2.拷贝下载文件到/opt/cloudera/parcel-repo

(1)CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel

(2)CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha1:需改名为CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha

(3)manifest.json

[root@hadoop102 cm-5.12.1]# mv /opt/software/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha1 /opt/software/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha

[root@hadoop102 module]# cp /opt/software/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha /opt/cloudera/parcel-repo/

[root@hadoop102 module]# cp /opt/software/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel /opt/cloudera/parcel-repo/

[root@hadoop102 module]# cp /opt/software/manifest.json /opt/cloudera/parcel-repo/

3.在Agent 节点(hadoop102,hadoop103,hadoop104)创建目录/opt/cloudera/parcels

[root@hadoop102 module]# mkdir -p /opt/cloudera/parcels

[root@hadoop102 module]# chown cloudera-scm:cloudera-scm /opt/cloudera/parcels

[root@hadoop103 module]# mkdir -p /opt/cloudera/parcels

[root@hadoop103 module]# chown cloudera-scm:cloudera-scm /opt/cloudera/parcels

[root@hadoop104 module]# mkdir -p /opt/cloudera/parcels

[root@hadoop104 module]# chown cloudera-scm:cloudera-scm /opt/cloudera/parcels

7分发Parcel-repo

[root@hadoop102 opt]# scp -r /opt/cloudera/ hadoop103:/opt/

[root@hadoop102 opt]# scp -r /opt/cloudera/ hadoop104:/opt/

8 启动和关闭CM Server&Agent 服务

服务节点:hadoop102

工作节点:hadoop102hadoop103hadoop104

注意:启动过程非常慢,Manager 启动成功需要等待一段时间,过程中会在数据库中创建对应的表需要耗费一些时间。

查看被占用则表示安装成功了!!!

访问http://hadoop102:7180,(用户名、密码:admin)

关闭:

服务节点:hadoop102

[root@hadoop102 init.d]# /opt/module/cloudera-manager/cm-5.12.1/etc/init.d/cloudera-scm-server stop

停止 cloudera-scm-server: [确定]

工作节点:hadoop102hadoop103hadoop104

[root@hadoop102 init.d]# /opt/module/cloudera-manager/cm-5.12.1/etc/init.d/cloudera-scm-agent stop

Stopping cloudera-scm-agent: [确定]

0 人点赞