环境情况
IP |
10.1.1.21 |
10.1.1.22 |
10.1.1.23 |
系统 |
Centos 7.9 x64 |
Centos 7.9 x64 |
Centos 7.9 x64 |
HostName |
cdh01 |
cdh02 |
cdh03 |
内存 |
24G |
8G |
8G |
硬盘 |
60G |
60G |
60G |
JDK |
1.8_271 |
1.8_271 |
1.8_271 |
MySQL |
5.7.31 |
- |
- |
CM |
6.3.1 |
6.3.1 |
6.3.1 |
Parcel |
6.3.2 |
6.3.2 |
6.3.2 |
软件情况
基础环境
三台机都需要操作
# 临时关闭
systemctl stop firewalld
# 永久关闭
systemctl disable firewalld
vim /etc/selinux/config
SELINUX=disabled
vim /etc/hosts
10.1.1.21 cdh01
10.1.1.22 cdh02
10.1.1.23 cdh03
vim /etc/rc.local
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
- NTP同步
- 第一台机指向外网时间服务器,后续第二第三台机指向第一台机
yum -y install ntp
[root@cdh01 ~]# vim /etc/ntp.conf
#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 ntp.aliyun.com
[root@cdh02 ~]# vim /etc/ntp.conf
#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 cdh01
tar -zxvf jdk-8u271-linux-x64.tar.gz
ln -s jdk1.8.0_271 java
chown -R root.root jdk1.8.0_271
mkdir -p /usr/java
ln -s /usr/local/java default
mkdir -p /usr/share/java
mv mysql-connector-java-5.1.38.jar mysql-connector-java.jar
MySQL安装
cdh01上安装
[root@cdh01 ~]# tar -zxvf mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz -C /usr/local
[root@cdh01 ~]# cd /usr/local
[root@cdh01 local]# ln -s mysql-5.7.31-linux-glibc2.12-x86_64 mysql
[root@cdh01 local]# mkdir mysql/data
[root@cdh01 local]# useradd -s /sbin/nologin mysql
[root@cdh01 local]# chown -R mysql.mysql mysql*
[root@cdh01 local]# rm -fr /etc/my.cnf
[root@cdh01 local]# yum -y install libaio.so.1 libaio
[root@cdh01 local]# ./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@cdh01 local]# cp support-files/mysql.server /etc/init.d/mysqld
[root@cdh01 local]# chkconfig --add mysqld
[root@cdh01 local]# service mysqld restart
[root@cdh01 local]# mysql -u root -p
mysql> set password=password('password');
mysql> grant all privileges on *.* to 'root'@'%' identified by 'password';
mysql> flush privileges;
mysql> exit;
Httpd安装
安装完后把软件拷贝到创建的目录下,然后启动httpd
[root@cdh01 ~]# yum -y install httpd
[root@cdh01 ~]# mkdir /var/www/html/parcel
[root@cdh01 ~]# cd /var/www/html/parcel
[root@cdh01 parcel]# mv CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha1 CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha
[root@cdh01 parcel]# systemctl start httpd
创建元数据库
create database cmf default character set utf8;
create database amon default character set utf8;
grant all privileges on cmf.* to 'cmf'@'%' identified by 'password';
grant all privileges on amon.* to 'amon'@'%' identified by 'password';
安装CM
cdh01中安装
[root@cdh01 ~]# rpm -ivh --nodeps --force cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@cdh01 ~]# rpm -ivh --nodeps --force cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm
修改数据库连接信息
[root@cdh01 ~]# vim /etc/cloudera-scm-server/db.properties
com.cloudera.cmf.db.type=mysql
com.cloudera.cmf.db.host=cdh01:3306
com.cloudera.cmf.db.name=cmf
com.cloudera.cmf.db.user=cmf
com.cloudera.cmf.db.password=password
com.cloudera.cmf.db.setupType=EXTERNAL
启动并查看日志
[root@cdh01 ~]# systemctl start cloudera-scm-server
[root@cdh01 ~]# tail -F /var/log/cloudera-scm-server/cloudera-scm-server.log
打开界面后不管,继续在三台机上安装agent
[root@cdh01 ~]# rpm -ivh --nodeps --force cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
[root@cdh01 ~]# vim /etc/cloudera-scm-agent/config.ini
server_host=cdh01
[root@cdh02 ~]# rpm -ivh --nodeps --force cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@cdh02 ~]# rpm -ivh --nodeps --force cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
[root@cdh02 ~]# vim /etc/cloudera-scm-agent/config.ini
server_host=cdh01
[root@cdh03 ~]# rpm -ivh --nodeps --force cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
[root@cdh03 ~]# rpm -ivh --nodeps --force cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
[root@cdh03 ~]# vim /etc/cloudera-scm-agent/config.ini
server_host=cdh01
启动所有agent
[root@cdh01 ~]# systemctl start cloudera-scm-agent
[root@cdh02 ~]# systemctl start cloudera-scm-agent
[root@cdh03 ~]# systemctl start cloudera-scm-agent
开始安装软件
完结
此次只安装基本的组件,如果有需要的后面可以自行再添加组件即可.机器配置只做参考,可灵活变动.