当前位置:   article > 正文

CM部署(2):CM环境配置及安装_cm配置文件

cm配置文件

一、机器分配

  1. 172.16.0.147 server(主节点)/agent
  2. mysql、namenode、resource manager、master、zookeeper、hiveserver、flume、SecondaryNamenode
  3. 172.16.0.115 agent (从节点)
  4. datanode、nodemanager、regionserver、zookeeper、namenode(热备)、hiveserver、flume
  5. 172.16.0.124 agent (从节点)
  6. datanode、nodemanager、regionserver、zookeeper 、resource manager(热备)、hiveserver、flume

二、安装mysql数据库

1.在第一台hadoop上安装mysql数据库

2.安装步骤参考之前的blog:

阿里云搭建大数据平台(6):Hive和mysql安装和配置,连接:https://blog.csdn.net/u010886217/article/details/83690267

三、CM的安装

1.安装第三方依赖(在所有服务器上)

yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse portmap fuse-libs redhat-lsb

2.下载上传对应版本cloudera-manager

下载地址http://archive.cloudera.com/cm5/cm/5/

因为系统是centos7,所以下载的是cloudera-manager-centos7-cm5.10.2_x86_64.tar.gz

注意:版本很重要,一定要与系统对应,否则启动会出现问题

3.安装

先在server主节点上创建一个CM的解压目录

  1. mkdir -p /opt/cloudera-manager
  2. tar -zxvf /opt/software/cloudera-manager-centos7-cm5.10.2_x86_64.tar.gz -C /opt/cloudera-manager/

4.在server主节点上修改agent配置【hadoop上】

  1. vi /opt/cloudera-manager/cm-5.10.2/etc/cloudera-scm-agent/config.ini
  2. # Hostname of the CM server.
  3. server_host=hadoop //指定server主节点
  4. # Port that the CM server is listening on.
  5. server_port=7182 //确认通信端口

5.拷贝CM解压后的包给其他服务器

  1. scp -r /opt/cloudera-manager/ hadoop02:/opt/
  2. scp -r /opt/cloudera-manager/ hadoop03:/opt/

6.创建cloudera Manager 专门用户

(1)第1-3台都需要

  1. useradd --system --home=/opt/cloudera-manager/cm-5.10.2/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm

详解:

  1. --system 表示创建的是系统用户
  2. --home=/opt/cloudera-manager/cm-5.10.2/run/cloudera-scm-server 指定用户主目录路径
  3. --no-create-home 不创建用户主目录
  4. --shell=/bin/false 不作为一个登陆用户
  5. --comment "Cloudera SCM User"
  6. cloudera-scm 用户名

(2)验证

  1. [root@hadoop cloudera-manager]# cat /etc/passwd | grep cloudera-scm
  2. cloudera-scm:x:997:995:Cloudera SCM User:/opt/cloudera-manager/cm-5.10.2/run/cloudera-scm-server:/bin/false

7.配置CM数据库的权限

(1)登陆主节点msyql

第一台hadoop

mysql -uroot -p123456

(2)给所有用户授权

  1. mysql> grant all privileges on *.* to 'cm'@'%' identified by 'cm' with grant option ;
  2. mysql> grant all privileges on *.* to 'cm'@'hadoop' identified by 'cm' with grant option;
  3. mysql> flush privileges ;

检查

  1. mysql> use mysql;
  2. Reading table information for completion of table and column names
  3. You can turn off this feature to get a quicker startup with -A
  4. Database changed
  5. mysql> select user,host from user;
  6. +--------+-----------+
  7. | user | host |
  8. +--------+-----------+
  9. | cm | % |
  10. | mysqld | % |
  11. | root | % |
  12. | cm | hadoop |
  13. | hue | localhost |
  14. +--------+-----------+
  15. 5 rows in set (0.00 sec)

(3)安装mysql驱动jar包到指定位置,否则(4)会报错

  1. cp mysql-connector-java-5.1.27-bin.jar /usr/share/java
  2. mv mysql-connector-java-5.1.27-bin.jar mysql-connector-java.jar

(4)初始化cm元数据信息

  1. //在主节点上
  2. # cd /opt/cloudera-manager/cm-5.10.2/share/cmf/schema
  3. //目录下scm_prepare_database.sh执行脚本文件命令
  4. # ./scm_prepare_database.sh mysql -h hadoop -ucm -pcm --scm-host hadoop scm scm scm

解释:

  1. 初始化mysql数据库
  2. scm:用户
  3. scm:密码
  4. scm:数据库

8.将CDH源放到cloudera Manager 主节点服务器上

(1)下载cm源,下载指定版本

http://archive.cloudera.com/cdh5/parcels/

(2)创建指定目录

  1. //在server主节点上创建,注意:目录名称不能变【第一台】
  2. # mkdir -p /opt/cloudera/parcel-repo
  3. //在agent主机节点上创建【第一二三台】
  4. # mkdir -p /opt/cloudera/parcels

(3)上传源文件到

mv /opt/software/CDH-5.10.2-1.cdh5.10.2.p0.5-el7.parcel* /opt/cloudera/parcel-repo/

(4)移动CDH源,去掉校验码文件结尾的1

mv CDH-5.10.2-1.cdh5.10.2.p0.5-el7.parcel.sha1 CDH-5.10.2-1.cdh5.10.2.p0.5-el7.parcel.sha

(5)更改parcel目录的所有人

  1. //server节点【第1台】
  2. # chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/
  3. //agent节点(所有agent节点)【第123台】
  4. # chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcels

9.启动CM进程

(1)启动server主节点

  1. (1)//CM的进程启动脚本目录
  2. # cd /opt/cloudera-manager/cm-5.10.2/etc/init.d
  3. (2)//启动命令,注意:至少需要8G内存
  4. # ./cloudera-scm-server start
  5. 结果:
  6. [root@hadoop init.d]# ./cloudera-scm-server start
  7. Starting cloudera-scm-server: [ OK ]
  8. (3)//server主进程的log日志目录
  9. # cd /opt/cloudera-manager/cm-5.10.2/log/cloudera-scm-server
  10. # tail -f cloudera-scm-server.log
  11. //CM控制台(等待5分钟)【最好等待5min】
  12. 结果:
  13. 2018-12-27 23:05:42,908 INFO WebServerImpl:com.cloudera.server.web.cmf.AggregatorController: AggregateSummaryScheduler started.
  14. 2018-12-27 23:05:44,469 INFO WebServerImpl:org.mortbay.log: jetty-6.1.26.cloudera.4
  15. 2018-12-27 23:05:44,470 INFO WebServerImpl:org.mortbay.log: Started SelectChannelConnector@0.0.0.0:7180
  16. 2018-12-27 23:05:44,470 INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.
  17. (4)检查
  18. jps
  19. 里面一个main就是server进程
  20. 结果:
  21. [root@hadoop cloudera-scm-server]# jps
  22. 2469 Main
  23. 2551 Jps
  24. 1084 WrapperSimpleApp

(2)启动agent从节点

  1. 1
  2. [root@hadoop init.d]# ./cloudera-scm-agent start
  3. Starting cloudera-scm-agent: [ OK ]
  4. 2
  5. [root@hadoop02 ~]# cd /opt/cloudera-manager/cm-5.10.2/etc/init.d/
  6. [root@hadoop02 init.d]# ./cloudera-scm-agent start
  7. Starting cloudera-scm-agent: [ OK
  8. 3
  9. [root@hadoop03 ~]# cd /opt/cloudera-manager/cm-5.10.2/etc/init.d/
  10. [root@hadoop03 init.d]# ./cloudera-scm-agent start
  11. Starting cloudera-scm-agent: [ OK

(3)检查agent进程

ps -ef | grep agent

(4)windows映射

修改C:\Windows\System32\drivers\etc

  1. 使用公网ip hadoop
  2. 使用公网ip hadoop02
  3. 使用公网ip hadoop03

(5)windows访问界面

  1. http://hadoop:7180
  2. 登陆 admin admin

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/484036
推荐阅读
  

闽ICP备14008679号