CDH集群部署
安装步骤
安装JDK
host修改
/etc/hosts配置文件
NTP时间同步
SSH免秘钥登录
安装mariadb
yum install install mariadb -y
mariadb 建表
1
2
3
4
5
6
7
8
9SET PASSWORD=PASSWORD('xcloud2017');
grant all privileges on *.* to 'root'@'%' identified by 'xcloud2017' with grant option; flush privileges;
create database scmdbn DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database monitor DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database report DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
安装cloudera-manager
所有节点都需要安装cloudera-manage,选某个节点安装执行命令如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22for i in {53..54}; do scp -P 2223 /usr/local/src/cdh-install.tar.gz root@124.238.237.$i:/root ; done
for i in {53..54}; do ssh -p 2223 "tar zxvf /usr/local/src/cdh-install.tar.gz -C /usr/local/src/" ; done
for i in {54..57}; do ssh -p 2223 root@124.238.237.$i "mkdir -p /opt/cloudera-manager" ; done
for i in {54..57}; do ssh -p 2223 root@124.238.237.$i "tar -axvf /usr/local/src/cdh/cloudera-manager-centos7-cm5.14.3_x86_64.tar.gz -C /opt/cloudera-manager" ; done
每台机器需要执行的操作:
1.useradd --system --home=/opt/cloudera-manager/cm-5.14.3/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
更改manager master机器IP,以及绑定端口号,
2. vim /opt/cloudera-manager/cm-5.14.3/etc/cloudera-scm-agent/config.ini
创建必要目录
3. mkdir -p /opt/cloudera/parcels; chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
主节点机器执行的操作:
mkdir /var/cloudera-scm-server;
chown cloudera-scm:cloudera-scm /var/cloudera-scm-server;
chown cloudera-scm:cloudera-scm /opt/cloudera-manager;
mkdir -p /opt/cloudera/parcel-repo;
chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo;
cp CDH-5.7.2-1.cdh5.7.2.p0.18-el7.parcel CDH-5.7.2-1.cdh5.7.2.p0.18-el7.parcel.sha manifest.json /opt/cloudera/parcel-repo ;启动cloudera组件
- 启动cloudera-manage
1
2
3
4
5
6
7
8
9
10
11
12cp /opt/cloudera-manager/cm-5.14.3/etc/init.d/cloudera-scm-server /etc/init.d/cloudera-scm-server;
chkconfig cloudera-scm-server on;
更改CMF_DEFAULTS目录,更改为/opt/cloudera-manager/cm-5.14.3/etc/default
vi /etc/init.d/cloudera-scm-server
chmod 755 /run/systemd/generator.late/cloudera-scm-*
service cloudera-scm-server start
#如果启动失败,查看/opt/cloudera-manager/cm-5.14.3/log/cloudera-scm-server/目录- 启动cloudera-agent
1
2
3
4
5
6
7
8
9
10
11每天机器agent机器执行:
for i in {53..57}; do ssh -p 2223 root@124.238.237.$i " cp /opt/cloudera-manager/cm-5.14.3/etc/init.d/cloudera-scm-agent /etc/init.d/cloudera-scm-agent" ; done
chkconfig cloudera-scm-agent on
CMF_DEFAULTS=${CMF_DEFAULTS:-/etc/default}改为=/opt/cloudera-manager/cm-5.14.3/etc/default
vi /etc/init.d/cloudera-scm-agent
service cloudera-scm-agent start
#如果启动失败,查看/opt/cloudera-manager/cm-5.14.3/log/cloudera-scm-agent/目录
Mysql配置文件
1 | [mysqld] |
组件配置
- iptables配置
开启防火墙,避免被提交yarn任务
1 | iptables-restore < /etc/sysconfig/iptables |
kafka配置
num.partitions 配置为10
default.replication.factor 配置为3
其余默认配置即可
flume配置
采集配置demo
1 | a1.sources = squid_source squidFlow_source |