1.离线部署主要分为三块
a.MySQL离线部署
b.CM离线部署
c.Parcel⽂文件离线源部
节点 | MySQL | Parcel离线源 | CM服务进程 | 大数据组件 |
---|---|---|---|---|
hadoop001 | MySQL | Parcel | Activity Monitor | NN RM DN NM |
hadoop002 | DN NM | |||
hadoop003 | DN NM | |||
hadoop004 | DN NM |
安装包
CM
cm6.3.1-redhat7.tar.gz
Parcel
CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel
CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel.sha1
manifest.json
JDK
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
下载jdk-8u181-linux-x64.tar.gz
MySQL
https://dev.mysql.com/downloads/mysql/5.7.html#downloads 下
载mysql-5.7.26-el7-x86_64.tar.gz
MySQL jdbc jar mysql-connector-java-5.1.47.jar
下载完成后要重命名去掉版本号: mv mysql-connector-java-5.1.47.jar mysql-connector-java.jar
echo “192.168.xxx.xxx hadoop001” >> /etc/hosts
echo “192.168.xxx.xxx hadoop001” >> /etc/hosts
echo “192.168.xxx.xxx hadoop001” >> /etc/hosts
echo “192.168.xxx.xxx hadoop001” >> /etc/hosts
systemctl stop firewalld
systemctl disable firewalld
iptables -F
vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled 设置后需要重启才能⽣生效
timedatectl set-timezone Asia/Shanghai
查看时间及时区
[root@hadoop001 ~]# timectl
-bash: timectl: command not found
[root@hadoop001 ~]# timedatectl
Local time: Wed 2018-01-29 17:38:16 CST
Universal time: Wed 2018-01-29 09:38:16 UTC
RTC time: Wed 2018-01-29 09:38:17
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
查看timedatectl 使用帮助
[root@hadoop001 ~]# timedatectl --help
timedatectl [OPTIONS...] COMMAND ...
Query or change system time and date settings.
-h --help Show this help message
--version Show package version
--no-pager Do not pipe output into a pager
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
-M --machine=CONTAINER Operate on local container
--adjust-system-clock Adjust system clock when changing local RTC mode
Commands:
status Show current time settings
set-time TIME Set system time
set-timezone ZONE Set system time zone
list-timezones Show known time zones
set-local-rtc BOOL Control whether RTC is in local time
set-ntp BOOL Control whether NTP is enabled
配置时钟同步:这里以hadoop001 联网进行时钟同步,其他节点与hadoop001同步
安装ntp yum install -y ntp
hadoop001 配置:
vi /etc/ntp.conf
增加如下内容
#time
server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
#当外部时间不可⽤时,可使⽤本地硬件时间
server 127.127.1.0 iburst local clock
#允许哪些⽹段的机器来同步时间
restrict 192.168.52.0 mask 255.255.255.0 nomodify notrap
开启ntp及查看状态:
[root@hadoop001 ~]# systemctl start ntpd
[root@hadoop001 ~]# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2018-01-29 17:11:32 CST; 32min ago
Process: 9170 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 9200 (ntpd)
CGroup: /system.slice/ntpd.service
└─9200 /usr/sbin/ntpd -u ntp:ntp -g
Jan 29 17:11:34 hadoop001 ntpd_intres[9202]: DNS 2.asia.pool.ntp.org -> 120.25.115.20
Jan 29 17:11:34 hadoop001 ntpd_intres[9202]: DNS 3.asia.pool.ntp.org -> 150.95.187.128
Jan 29 17:11:34 hadoop001 ntpd_intres[9202]: DNS 0.centos.pool.ntp.org -> 84.16.67.12
Jan 29 17:11:34 hadoop001 ntpd_intres[9202]: DNS 1.centos.pool.ntp.org -> 78.46.102.180
Jan 29 17:11:34 hadoop001 ntpd_intres[9202]: DNS 2.centos.pool.ntp.org -> 95.216.200.137
Jan 29 17:11:34 hadoop001 ntpd_intres[9202]: DNS 3.centos.pool.ntp.org -> 193.182.111.14
Jan 29 17:11:34 hadoop001 ntpd[9200]: Listen normally on 4 ens33 192.168.52.200 UDP 123
Jan 29 17:11:34 hadoop001 ntpd[9200]: new interface(s) found: waking up resolver
Jan 29 17:11:36 hadoop001 ntpd[9200]: Listen normally on 5 ens33 fe80::d8d:fbba:1681:5d8 UDP 123
Jan 29 17:11:36 hadoop001 ntpd[9200]: new interface(s) found: waking up resolver
其他从节点停⽌禁⽤ntpd服务,并向hadoop001 进行时钟同步
从节点执行:
[root@hadoop002 ~]# systemctl stop ntpd
[root@hadoop002 ~]# systemctl disable ntpd
Removed symlink /etc/systemd/system/multi-user.target.wants/ntpd.service.
[root@hadoop002 ~]# /usr/sbin/ntpdate hadoop001
# 创建文件夹
mkdir /usr/java
tar -xzvf jdk-8u181-linux-x64.gz -C /usr/java/
#切记必须修正所属⽤用户及⽤用户组
chown -R root:root /usr/java/jdk1.8.0_181
echo "export JAVA_HOME=/usr/java/jdk1.8.0_181" >> /etc/profile echo
# 配置环境变量
"export PATH=/usr/java/jdk1.8.0_181/bin:${PATH}" >> /etc/profile
# source一下
source /etc/profile
# 查看是否配置成功
which java
部署完成登录mysql
create database cmf DEFAULT CHARACTER SET utf8;
create database amon DEFAULT CHARACTER SET utf8;
grant all on cmf.* TO 'cmf'@'%' IDENTIFIED BY 'xxxxx';
grant all on amon.* TO 'amon'@'%' IDENTIFIED BY 'xxxxxx';
flush privileges;
mkdir -p /usr/share/java/
cp mysql-connector-java-5.1.47.jar /usr/share/java/mysql-connector-java.jar
1.1.所有节点创建⽬目录及解压
mkdir /opt/cloudera-manager
tar -xzvf cm6.3.1-redhat7.tar.gz -C /opt/cloudera-manager/
1.2.选择hadoop001为cm server,不不下载依赖包直接部署
cd /opt/cloudera-manager/cm6.3.1/RPMS/x86_64
rpm -ivh cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm --nodeps --force
rpm -ivh cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm --nodeps --force
1.3.所有节点(包含hadoop001)为cm agent,不不下载依赖包直接部署
cd /opt/cloudera-manager/cm6.3.1/RPMS/x86_64
rpm -ivh cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm --nodeps --force
rpm -ivh cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm --nodeps --force
1.4.所有节点修改agent的配置,指向server的节点hadoop001
sed -i "s/server_host=localhost/server_host=hadoop001/g" /etc/cloudera-scm-agen t/config.ini
1.5.主节点修改server的配置:
vi /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.type=mysql
com.cloudera.cmf.db.host=hadoop001
com.cloudera.cmf.db.name=cmf
com.cloudera.cmf.db.user=cmf
com.cloudera.cmf.db.password=www.ruozedata.com
com.cloudera.cmf.db.setupType=EXTERNAL
2.1.安装httpd服务
yum install -y httpd
2.2.部署离线parcel源
$ mkdir -p /var/www/html/cdh6_parcel
[root@hadoop001 CDH6.3.1]# cp CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel /var/ www/html/cdh6_parcel/
[root@hadoop001 CDH6.3.1]# mv CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel.sha1 / var/www/html/cdh6_parcel/CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel.sha [root@hadoop001 CDH6.3.1]# mv manifest.json /var/www/html/cdh6_parcel/
$ ll
total 3081664
-rw-r--r-- 1 root root 2083878000 Oct 23 13:44 CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7 .parcel
-rw-r--r-- 1 root root 40 Oct 23 13:44 CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7 .parcel.sha1
-rw-r--r-- 1 root root 1411444147 Oct 23 13:43 cm6.3.1-redhat7.tar.gz
-rw-r--r-- 1 root root 173271626 Oct 23 13:43 jdk-8u45-linux-x64.gz
-rw-r--r-- 1 root root 33887 Oct 23 13:43 manifest.json
-rw-r--r-- 1 root root 548193637 Oct 23 13:42 mysql-5.7.11-linux-glibc2.5-x86_64. tar.gz
-rw-r--r-- 1 root root 1007502 Sep 1 12:31 mysql-connector-java-5.1.47.jar
$ mv CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel /var/www/html/cdh6_parcel/
$ mv CDH-6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel.sha1 /var/www/html/cdh6_parcel/CDH -6.3.1-1.cdh6.3.1.p0.1470567-el7.parcel.sha
$ mv manifest.json /var/www/html/cdh6_parcel/
sha1名称⽂文件时,重命名去掉1,不不然在部署过程CM认为如上⽂文件下载未完整,会持续下载
2.3.启动httpd,window查看 systemctl start httpd
http://hadoop001/cdh6_parcel/ 查看是否可以访问
3.1.启动server
systemctl start cloudera-scm-server
查看⽇日志:
cd /var/log/cloudera-scm-server/
$ ll
total 20
-rw-r----- 1 cloudera-scm cloudera-scm 18265 Oct 23 15:37 cloudera-scm-server.log
-rw-r----- 1 cloudera-scm cloudera-scm 0 Oct 23 15:37 cmf-server-nio.log
-rw-r----- 1 cloudera-scm cloudera-scm 0 Oct 23 15:37 cmf-server-perf.log
$ tail -F cloudera-scm-server.log
有错误就根据错误解决,没有错误,等待1min,出现7180端⼝口,表明是成功的。
假如打不不开,去看server的log,根据错误仔细排查错误
等待1min,打开 http://hadoop001:7180 账号密码:admin/admin
systemctl start cloudera-scm-agent
http://hadoop001:7180/ 账号密码:admin/admin