CDH是Cloudera的100%开源平台发行版,包括Apache Hadoop,专为满足企业需求而构建。CDH提供开箱即用的企业使用所需的一切。通过将Hadoop与十几个其他关键的开源项目集成,Cloudera创建了一个功能先进的系统,可帮助您执行端到端的大数据工作流程。
简单来说:CDH 是一个拥有集群自动化安装、中心化管理、集群监控、报警功能的一个工具(软件),使得集群的安装可以从几天的时间缩短为几个小时,运维人数也会从数十人降低到几个人,极大的提高了集群管理的效率。
1)管理:对集群进行管理,例如添加、删除节点等操作
2)监控:监控集群的健康情况,对设置的各种指标和系统的具体运行情况进行全面的监控
3)诊断:对集群出现的各种问题进行诊断,并且给出建议和解决方案
4)集成:多组件可以进行版本兼容间的整合
cloudera manager的核心是管理服务器,该服务器承载管理控制台的Web服务器和应用程序逻辑,并负责安装软件,配置,启动和停止服务,以及管理上的服务运行群集。
Cloudera Manager Server由以下几个部分组成:
Agent:安装在每台主机上。该代理负责启动和停止的过程,拆包配置,触发装置和监控主机。
Management Service:由一组执行各种监控,警报和报告功能角色的服务。
Database:存储配置和监视信息。通常情况下,多个逻辑数据库在一个或多个数据库服务器上运行。
Cloudera Repository:软件由Cloudera 管理分布存储库。
Clients:是用于与服务器进行交互的接口。
Admin Console :基于Web的用户界面与管理员管理集群和Cloudera管理。
API :与开发人员创建自定义的Cloudera Manager应用程序的API。
外网地址 | 内网地址 | 主机名 | 硬件配置 | 操作系统 |
---|---|---|---|---|
8.130.178.205 | 172.28.54.188 | cm-server | 4C16G | Centos7 |
8.130.176.96 | 172.28.54.189 | agent01 | 4C16G | Centos7 |
8.130.178.100 | 172.28.54.190 | agent02 | 4C16G | Centos7 |
8.130.173.93 | 172.28.54.191 | agent03 | 4C16G | Centos7 |
cm-server用于部署server端、agent端、MySQL5.7
agent01、agent02、agent03用于部署集群节点( agent做实验2个即可 )
根据各节点ip地址规划更改对应的主机名
# 分别在各服务器上执行hostnamectl
172.28.54.188 # hostnamectl set-hostname cm-server
172.28.54.189 # hostnamectl set-hostname agent01
172.28.54.190 # hostnamectl set-hostname agent02
172.28.54.191 # hostnamectl set-hostname agent03
# 查看系统版本号
[root@cm-server ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
# 查看内存情况
[root@cm-server ~]# free -g
total used free shared buff/cache available
Mem: 15 0 14 0 0 14
Swap: 0 0 0
# 查看系统核数
[root@cm-server ~]# lscpu | head -4 | tail -1
CPU(s): 4
# 服务器均为CentOS7 | 4C | 16G
# 生成密钥,直接回车完成
[root@cm-server ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:lIkOqB1t3HvO2hJpxZjRWaroPT6d0qRSyJLa9NVtcvg root@cm-server
The key's randomart image is:
+---[RSA 2048]----+
| . o. |
| + ...o+ |
| o = o== |
| o o +o+o |
|. .o..++So |
| +.o.*+= + |
| + o.+o*o* |
|. . o.=++ E |
| .o+. |
+----[SHA256]-----+
# 分发密钥
[root@cm-server ~]# ssh-copy-id 172.28.54.188
[root@cm-server ~]# ssh-copy-id 172.28.54.189
[root@cm-server ~]# ssh-copy-id 172.28.54.190
[root@cm-server ~]# ssh-copy-id 172.28.54.191
# 在agent01、agent02、agent03 上执行相同操作( 建议第一次免密设置完成后手动全部ssh登陆一次 )
[root@cm-server ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# CDH
172.28.54.188 cm-server
172.28.54.189 agent01
172.28.54.190 agent02
172.28.54.191 agent03
# 把cm-server端编辑好的hosts文件分发各个agent
[root@cm-server ~]# scp /etc/hosts agent01:/etc/hosts
[root@cm-server ~]# scp /etc/hosts agent02:/etc/hosts
[root@cm-server ~]# scp /etc/hosts agent03:/etc/hosts
安装所需各组件已经分享至云盘:
链接:https://pan.baidu.com/s/155VuPtJC8v7SC_HfzbSZ4Q
提取码:aa0c
将目录下所有包下载并上传至服务器
[root@cm-server software]# ll
total 3412032
-rw-r--r-- 1 root root 2082186246 Sep 13 11:58 CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel
-rw-r--r-- 1 root root 40 Sep 13 11:44 CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha
-rw-r--r-- 1 root root 10483568 Sep 13 11:45 cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 1203832464 Sep 13 11:55 cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 11488 Sep 13 11:55 cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 194990602 Sep 13 13:36 jdk-8u211-linux-x64.tar.gz
drwxr-xr-x 2 root root 4096 Sep 13 13:34 mysql
-rw-r--r-- 1 root root 2385601 Sep 13 11:55 mysql-connector-java-8.0.20.jar
# 各服务器节点均执行
[root@cm-server software]# systemctl disable firewalld
[root@cm-server software]# systemctl stop firewalld
# 各服务器节点均执行
[root@cm-server ~]# setenforce 0
setenforce: SELinux is disabled
[root@cm-server ~]# vim /etc/selinux/config
# 将SELINUX置为disabled
SELINUX=disabled
[root@cm-server ~]# vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# server 0.centos.pool.ntp.org iburst
# server 1.centos.pool.ntp.org iburst
# server 2.centos.pool.ntp.org iburst
# server 3.centos.pool.ntp.org iburst
server cm-server iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Allow NTP client access from local network.
# allow 192.168.0.0/16
allow 172.28.54.0/24
# Serve time even if not synchronized to a time source.
local stratum 10
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking
# 分发chrony配置
[root@cm-server ~]# scp /etc/chrony.conf agent01:/etc/chrony.conf
[root@cm-server ~]# scp /etc/chrony.conf agent02:/etc/chrony.conf
[root@cm-server ~]# scp /etc/chrony.conf agent03:/etc/chrony.conf
# 各服务器重启chronyd服务和开机自启
[root@cm-server ~]# systemctl restart chronyd && systemctl enable chronyd
[root@agent01 ~]# systemctl restart chronyd && systemctl enable chronyd
[root@agent02 ~]# systemctl restart chronyd && systemctl enable chronyd
[root@agent03 ~]# systemctl restart chronyd && systemctl enable chronyd
# 查看各节点的运行状况
[root@cm-server ~]# for i in cm-server agent01 agent02 agent03;do echo $i && ssh $i "chronyc sources";done
cm-server
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* cm-server 10 6 377 569 -0ns[-3188ns] +/- 4623ns
agent01
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* cm-server 11 8 377 146 +3692ns[+5089ns] +/- 538us
agent02
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* cm-server 11 10 377 112 -1420ns[-1934ns] +/- 583us
agent03
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* cm-server 11 10 377 139 -2145ns[-2926ns] +/- 556us
vm.swappiness 参数可以调整机器使用内存、交互分区的比例。vm.swappiness 的取值范围在 0-100 之间,当 vm.swappiness 为 0 时,表示最大限度地使用物理内存,而后使用 swap 空间;当 swappiness 为 100 时,表示最大限度地使用 swap 空间,把内存中的数据及时搬运到 swap 空间中去。
# 各服务器节点均执行
[root@cm-server software]# vim /etc/sysctl.conf
vm.swappiness = 0
大多数 Linux 平台都包含一个称为透明大页面的功能,该功能与 Hadoop 工作节点的交互很差,并且会严重降低性能。
查看透明大页是否启用,[always] never 表示已启用,always [never] 表示已禁用。
# 各服务器节点均执行
[root@cm-server ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
[root@cm-server ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
Centos7 默认已经安装了 Python 2.7.5 版本,如果系统没有安装,或者没有安装则使用以下命令安装:
[root@cm-server software]# python -V
Python 2.7.5
# 各节点执行相同操作 如果系统没有安装python执行(yum install -y python275)
# 进入安装包目录
[root@cm-server ~]# cd /opt/software/
# 解压java安装包
[root@cm-server software]# tar -xf jdk-8u211-linux-x64.tar.gz
# 创建目录,将java移至使用目录
[root@cm-server software]# mkdir -p /usr/java
[root@cm-server software]# mv jdk1.8.0_211 /usr/java/default
[root@cm-server software]# ll /usr/java/default/
total 26000
drwxr-xr-x 2 10 143 4096 Apr 2 2019 bin
-r--r--r-- 1 10 143 3244 Apr 2 2019 COPYRIGHT
drwxr-xr-x 3 10 143 4096 Apr 2 2019 include
-rw-r--r-- 1 10 143 5213268 Mar 14 2019 javafx-src.zip
drwxr-xr-x 5 10 143 4096 Apr 2 2019 jre
drwxr-xr-x 5 10 143 4096 Apr 2 2019 lib
-r--r--r-- 1 10 143 44 Apr 2 2019 LICENSE
drwxr-xr-x 4 10 143 4096 Apr 2 2019 man
-r--r--r-- 1 10 143 159 Apr 2 2019 README.html
-rw-r--r-- 1 10 143 424 Apr 2 2019 release
-rw-r--r-- 1 10 143 21105019 Apr 2 2019 src.zip
-rw-r--r-- 1 10 143 112748 Mar 14 2019 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r-- 1 10 143 149725 Apr 2 2019 THIRDPARTYLICENSEREADME.txt
# 增加环境变量参数
[root@cm-server software]# vim /etc/profile
# JAVA_HOME
export JAVA_HOME=/usr/java/default
export CLASSPATH=./:$JAVA_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
# 引用变量参数,使profile文件生效
[root@cm-server software]# source /etc/profile
# 验证java
[root@cm-server software]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
# 其它各agent节点创建java文件目录
[root@agent01 ~]# mkdir -p /usr/java
[root@agent02 ~]# mkdir -p /usr/java
[root@agent03 ~]# mkdir -p /usr/java
# 分发java目录
[root@cm-server software]# scp -r /usr/java/default agent01:/usr/java/
[root@cm-server software]# scp -r /usr/java/default agent02:/usr/java/
[root@cm-server software]# scp -r /usr/java/default agent03:/usr/java/
# 在各agent节点上增加环境变量参数并source 引用
vim /etc/profile # 增加环境变量
source /etc/profile # 引用配置文件
# 进入mysql安装包目录
[root@cm-server ~]# cd /opt/software/mysql
# 安装mysql依赖
[root@cm-server mysql]# rpm -ivh 01_mysql-community-common-5.7.29-1.el7.x86_64.rpm
[root@cm-server mysql]# rpm -ivh 02_mysql-community-libs-5.7.29-1.el7.x86_64.rpm
[root@cm-server mysql]# rpm -ivh 03_mysql-community-libs-compat-5.7.29-1.el7.x86_64.rpm
# 安装mysql-client
[root@cm-server mysql]# rpm -ivh 04_mysql-community-client-5.7.29-1.el7.x86_64.rpm
# 安装mysql-server
[root@cm-server mysql]# rpm -ivh 05_mysql-community-server-5.7.29-1.el7.x86_64.rpm
# 【注意】 安装过程中如果出现报错失败;大多都是因lib冲突,或者小版本依赖等问题,可以根据报错做如下一些常用的依赖清理和依赖处理
# 以下罗列常用的解决办法
# 库冲突:清理mysql-libs库
# [root@cm-server software]# yum remove mysql-libs
# 缺少依赖:安装libaio autoconf
# [root@cm-server software]# yum install -y libaio autoconf
# 提示mariadb相关的报错:删除mariadb的lib库
# [root@cm-server software]# rpm -qa | grep mariadb
# mariadb-libs-5.5.56-2.el7.x86_64
# [root@cm-server software]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
# 启动mysql并设置开机自启
[root@cm-server mysql]# systemctl start mysqld && systemctl enable mysqld
# 查看新装mysql密码
[root@cm-server mysql]# cat /var/log/mysqld.log | grep password
2021-09-13T07:56:47.599484Z 1 [Note] A temporary password is generated for root@localhost: (PN3pKgLz/pX
# 通过日志获取到初始密码 (PN3pKgLz/pX
# 用刚刚查到的密码进入mysql(初始密码中可能会有各种符号,命令行登录如果报错,给密码加单引号)
[root@cm-server mysql]# mysql -uroot -p'(PN3pKgLz/pX'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.29
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# 设置复杂密码(由于mysql密码策略,此密码必须足够复杂)
mysql> set password=password("Wangt@123");
Query OK, 0 rows affected, 1 warning (0.00 sec)
# 更改mysql密码策略
mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
# 设置简单好记的密码
mysql> set password=password("123456");
Query OK, 0 rows affected, 1 warning (0.00 sec)
# 切到msyql系统库
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
# 查询user表
mysql> select user, host from user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
3 rows in set (0.00 sec)
# 修改user表,把Host表内容修改为% , 扩大数据库登录范围
mysql> update user set host="%" where user="root";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
# 刷新更改配置
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
# 退出MySQL
mysql> quit;
Bye
# 查看MySQL版本
[root@cm-server mysql]# mysql -V
mysql Ver 14.14 Distrib 5.7.29, for Linux (x86_64) using EditLine wrapper
# 尝试使用新密码123456,重新登陆MySQL
[root@cm-server mysql]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# 导入cdh_db.sql文件;一些服务的库、用户名和密码,可以先自行修改密码再执行
mysql> source cdh_db.sql
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> quit;
Bye
# cm-server上拷贝
[root@cm-server mysql]# cd /opt/software/
[root@cm-server software]# mkdir -p /usr/share/java/
[root@cm-server software]# cp mysql-connector-java-8.0.20.jar /usr/share/java/mysql-connector-java.jar
# 在各agent创建目录
[root@agent01 ~]# mkdir -p /usr/share/java/
[root@agent02 ~]# mkdir -p /usr/share/java/
[root@agent03 ~]# mkdir -p /usr/share/java/
# 将cm-server的jdbc驱动包分发各agent节点/usr/share/java/目录
[root@cm-server ~]# cd /opt/software/
[root@cm-server software]# scp mysql-connector-java-8.0.20.jar agent01:/usr/share/java/mysql-connector-java.jar
[root@cm-server software]# scp mysql-connector-java-8.0.20.jar agent02:/usr/share/java/mysql-connector-java.jar
[root@cm-server software]# scp mysql-connector-java-8.0.20.jar agent03:/usr/share/java/mysql-connector-java.jar
# cm-server上安装
[root@cm-server software]# yum install -y cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@cm-server software]# yum install -y cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm
# server上分发agent安装包
[root@cm-server software]# scp cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm agent01:~/
[root@cm-server software]# scp cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm agent02:~/
[root@cm-server software]# scp cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm agent03:~/
[root@cm-server software]# scp cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm agent01:~/
[root@cm-server software]# scp cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm agent02:~/
[root@cm-server software]# scp cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm agent03:~/
# 所有上安装agent服务,这里没有全部贴出来,注意agent节点均需要安装
[root@agent01 ~]# yum install -y cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@agent01 ~]# yum install -y cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
# 所有节点上更改agent配置文件
[root@cm-server ~]# vim /etc/cloudera-scm-agent/config.ini
# 将server_host的配置改为server的主机名 [ 主机名是自己环境的server的host主机名 ]
server_host=cm-server
[root@cm-server software]# ll /opt/cloudera/cm/schema/scm_prepare_database.sh
-rwxr-xr-x 1 root root 12450 Sep 25 2019 /opt/cloudera/cm/schema/scm_prepare_database.sh
# 注意替换ip地址,如果创建时,cdh_db.sql的密码改过这里需要对应改密码
[root@cm-server software]# /opt/cloudera/cm/schema/scm_prepare_database.sh -h 172.28.54.188 mysql scm scm 123456
JAVA_HOME=/usr/java/default
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing: /usr/java/default/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/opt/cloudera/cm/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /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".
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[2021-09-13 17:36:20,877] INFO 0[main] - com.cloudera.enterprise.dbutil.DbCommandExecutor.testDbConnection(DbCommandExecutor.java) - Successfully connected to database.
All done, your SCM database is configured correctly! # 表示初始化成功
[root@cm-server software]# cp /opt/software/CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel /opt/cloudera/parcel-repo/
[root@cm-server software]# cp /opt/software/CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha /opt/cloudera/parcel-repo/
文件放置在/opt/cloudera/parcel-repo/目录下以后,在后续的界面安装各个服务时,在目录中找到版本文件,可以自动匹配到安装文件,无需连外网下载。
# cm-server
[root@cm-server software]# systemctl start cloudera-scm-server
[root@cm-server software]# systemctl enable cloudera-scm-server
# 所有节点cm-server和各agent
[root@cm-server software]# systemctl start cloudera-scm-agent
[root@cm-server software]# systemctl enable cloudera-scm-agent
http:cm-serverIP:7180 ( admin / admin )
[注意]:如果部署用的是阿里云等公有云安装,需要在对应的公有云上把对应的端口策略打开,才可以访问。
登陆后,有欢迎页面,无需操作,点击继续即可;
Accept License一些条款协议,点击同意,继续即可;
选择版本后,再次有欢迎页面,无需操作,点击继续即可;
选择版本后,Clouder Manager Server 会将 parcel 解压,分发,安装到每一台选择 Clouder Manager Agent 的服务器;需要耐心等待进度完成后才可点击下一步。
一般结果中都会告诉每个问题的处理办法,照着操作即可,最后再重新运行检查
默认即可,需要优化性能或者最佳合理分配可自行更改
如果发现需要的数据库、用户名、密码不存在,可以参照执行的sql文件格式,新增库和用户名等
【注意】:如果提示JDBC driver cannot be found. Unable to find the JDBC database jar on host : xxxxx,说明jdbc的驱动包没有分发到各节点去,这个必须要各节点都有,容易忽略。
等待各组件安装完成
看到汇总页:服务已安装,配置并在集群中运行,则完成安装
13.登陆 Clouder Manager 管理界面
点击完成后,即可跳转至管理界面了,后续使用以及维护全部围绕管理界面来完成,以及检查监控集群各组件运行情况
点击标识,可以看到详细的内容,例如:存在隐患 : 9 DataNodes are required for the erasure coding policies: RS-6-3-1024k. The number of DataNodes is only 3. ( 节点数过少,这里只是实验,可以无视,真正生产环境节点数量较多 )
例如新增flume服务,勾选flume,然后选择角色分配部署节点,继续
最后部署汇总,点击完成
启动新增的服务
等待启动步骤完成
服务添加完成
各个服务的配置文件无需登陆服务器,管理页面点击对应服务中可以导出,十分便利
点击下载,可以将配置文件压缩包下载至本地,解压查看
在主机页 -> 角色中可以查看到集群中
切换至普通用户登陆查看,用户大多对于集群的操作均已被隐藏
示例:
快照备份可以是hdfs等不同的存储介质进行备份。
在主机页 - > 所有主机 点击对应主机可以跳转至对应主机服务器的各指标监控页
各监控项查看
172.28.54.192 # hostnamectl set-hostname agent04
# cm-server
[root@cm-server ~]# ssh-copy-id 172.28.54.192
# cm-server
[root@cm-server ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# CDH
172.28.54.188 cm-server
172.28.54.189 agent01
172.28.54.190 agent02
172.28.54.191 agent03
172.28.54.192 agent04
# 分发新hosts
[root@cm-server ~]# for i in agent01 agent02 agent03 agent04;do scp /etc/hosts $i:/etc/hosts;done
[root@agent04 ~]# systemctl disable firewalld
[root@agent04 ~]# systemctl stop firewalld
[root@agent04 ~]# setenforce 0
setenforce: SELinux is disabled
[root@cm-server ~]# vim /etc/selinux/config
# 将SELINUX置为disabled
SELINUX=disabled
# cm-server
[root@cm-server ~]# scp /etc/chrony.conf agent04:/etc/chrony.conf
# agent04
[root@agent04 ~]# systemctl restart chronyd && systemctl enable chronyd
[root@agent04 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* cm-server 11 6 17 21 +990ns[ -714ns] +/- 91ms
[root@agent04 ~]#
[root@agent04 ~]# vim /etc/sysctl.conf
vm.swappiness = 0
[root@agent04 ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
[root@agent04 ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@agent04 ~]# python -V
Python 2.7.5
# 创建java文件目录
[root@agent04 ~]# mkdir -p /usr/java
# cm-server 直接从server端拷贝
[root@cm-server ~]# scp -r /usr/java/default agent04:/usr/java/
# 环境变量profile
[root@agent04 ~]# vim /etc/profile
# JAVA_HOME
export JAVA_HOME=/usr/java/default
export CLASSPATH=./:$JAVA_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
# 引用生效
[root@agent04 ~]# source /etc/profile
# cm-server
[root@cm-server ~]# scp /opt/software/mysql-connector-java-8.0.20.jar agent03:/usr/share/java/mysql-connector-java.jar
# 将安装包从cm-server分发过去
[root@cm-server ~]# cd /opt/software/
[root@cm-server software]# scp cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm agent04:~/
[root@cm-server software]# scp cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm agent04:~/
# 在agent04上执行安装
[root@agent04 ~]# ll
total 1185864
-rw-r--r-- 1 root root 10483568 Sep 14 15:14 cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 1203832464 Sep 14 15:14 cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@agent04 ~]# yum install -y cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@agent04 ~]# yum install -y cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
# 修改agent服务的配置文件指向server
[root@agent04 ~]# vim /etc/cloudera-scm-agent/config.ini
# 将server_host的配置改为server的主机名 [ 主机名是自己环境的server的host主机名 ]
server_host=cm-server
[root@agent04 ~]# systemctl start cloudera-scm-agent
[root@agent04 ~]# systemctl enable cloudera-scm-agent
找到Add Hosts
选择添加到哪个集群并继续
选择当前管理的主机,会将还未加入到集群的新节点罗列出来
Install Parcels和检查主机正确性操作与之前相同,这里跳过
选择主机模板,如果长期使用的集群,一般都会有模板的,主要是节点的角色,创建好直接有哪些服务的node等等;没有则可以直接选择无,代表加入集群后,手动添加服务实例。
等待部署客户端基本配置和环境点击完成
将服务实例部署至新agent
在添加时根据自己需求即可,例如DataNode
添加agent04的角色,所以建议长期使用创建要给模板最佳,相对方便
至此,添加一个新集群节点,并设置新服务实例全部完成