CDH5.16.1集群离线部署
离线部署节点规划:
节点 | MySQL组件 | Parcel文件离线源 | CM服务进程 | 大数据组件 |
---|---|---|---|---|
Hadoop001 | MySQL | Parcel | Activity Monitor | NN RM DN NM |
Hadoop002 | Alert Publisher Event Server | DN NM | ||
Hadoop003 | Host Monitor Service Monitor | DN NM |
离线部署步骤:
- mysql离线部署
- CM 离线部署
- Parcel离线部署
下载源:
JDK
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
下载jdk-8u202-linux-x64.tar.gz
MySQL
https://dev.mysql.com/downloads/mysql/5.7.html#downloads
MySQL JDBC Jar
http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar
使用的时候去掉版本号mv mysql-connector-java-5.1.47.jar mysql-connector-java.jar
CM
http://archive.cloudera.com/cm5/cm/5/cloudera-manager-centos7-cm5.16.1_x86_64.tar.gz
Parcel
http://archive.cloudera.com/cdh5/parcels/5.16.1/CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel
http://archive.cloudera.com/cdh5/parcels/5.16.1/CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha1
http://archive.cloudera.com/cdh5/parcels/5.16.1/manifest.json
集群机器的准备工作:
1.所有节点配置Linux机器的hosts文件
1 | 192.168.52.200 hadoop001 |
2.所有节点禁用防火墙并清空规则
1 | 查看防火墙状态:firewall-cmd --state |
3.关闭所有节点的selinux
vi /etc/selinux/config
1 | 将SELINUX=enforcing改为SELINUX=disabled 重启生效 |
4.设置所有节点时钟同步
查看时间及时区
1 | [root@hadoop001 ~]# timedatectl |
查看timedatectl 使用帮助
1 | [root@hadoop001 ~]# timedatectl --help |
配置时钟同步:这里以hadoop001 联网进行时钟同步,其他节点与hadoop001同步
安装ntpyum install -y ntp
hadoop001 配置:
vi /etc/ntp.conf
增加如下内容
1 | #time |
开启ntp及查看状态:
1 | [root@hadoop001 ~]# systemctl start ntpd |
其他从节点停⽌禁⽤ntpd服务,并向hadoop001 进行时钟同步
从节点执行:
1 | [root@hadoop002 ~]# systemctl stop ntpd |
1 | 设置定时任务每天隔10分钟同步hadoop001节点时间 |
安装JDK
将jdk统一安装到/usr/java 下面
mkdir /usr/java
tar -xzvf jdk-8u45-linux-x64.tar.gz -C /usr/java/
#切记必须修正所属⽤户及⽤户组
chown -R root:root /usr/java/jdk1.8.0_45
配置环境变量:
vim /etc/profile
1 | export JAVA_HOME=/usr/java/jdk1.8.0_45 |
hadoop001节点 安装MySQL
创建CDH的元数据库和⽤户、amon服务的数据库及⽤户
1 | create database cmf DEFAULT CHARACTER SET utf8; |
hadoop001 部署mysql驱动包
1 | mkdir -p /usr/share/java/ |
CDH部署
1.离线部署cm server及agent
1.1.所有节点创建⽬录及解压
mkdir /opt/cloudera-manager
tar -zxvf cloudera-manager-centos7-cm5.16.1_x86_64.tar.gz -C /opt/cloudera-manager/
1.2.所有节点修改agent的配置,指向server的节点hadoop001
vi /opt/cloudera-manager/cm5.16.1/etc/cloudera-scm-agent/config.ini
1 | # Hostname of the CM server. |
1.3.主节点修改server的配置:
vi /opt/cloudera-manager/cm-5.16.1/etc/cloudera-scm-server/db.properties
1 | com.cloudera.cmf.db.type=mysql |
1.4.所有节点创建⽤户
1 | useradd --system --home=/opt/cloudera-manager/cm-5.16.1/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm |
1.5.⽬录修改⽤户及⽤户组
chown -R cloudera-scm:cloudera-scm /opt/cloudera-manager
2.hadoop001节点部署离线parcel源
2.1.部署离线parcel源
1 | $ mkdir -p /opt/cloudera/parcel-repo |
#切记cp时,重命名去掉1,不然在部署过程CM认为如上⽂件下载未完整,会持续下载
1 | $ cp CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha1 /opt/cloudera/parcel-repo/CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha |
2.2.⽬录修改⽤户及⽤户组
1 | $ chown -R cloudera-scm:cloudera-scm /opt/cloudera/ |
3.所有节点创建软件安装⽬录、⽤户及⽤户组权限
mkdir -p /opt/cloudera/parcels chown -R cloudera-scm:cloudera-scm /opt/cloudera/
4.hadoop001节点启动Server
4.1.启动server
/opt/cloudera-manager/cm-5.16.1/etc/init.d/cloudera-scm-server start
4.2.云主机web界⾯,设置该hadoop001节点防⽕墙放开7180端⼝
4.3.等待1min,打开 http://hadoop001:7180 账号密码:admin/admin
4.4.假如打不开,去看server的log,根据错误仔细排查错误
4.5使用tail -F /opt/cloudera-manager/cm-5.16.1/log/cloudera-scm-server/cloudera-scm-server.log监控日志
5.所有节点启动Agent
/opt/cloudera-manager/cm-5.16.1/etc/init.d/cloudera-scm-agent start
6.登录web界面安装集群
bigdata123456!