离线部署CDH6.3.1

离线部署CDH6.3.1,第1张

离线部署CDH6.3.1 1.安装环境准备 1.1更改节点

各节点对应执行以下命令
hostnamectl set-hostname cdh01
hostnamectl set-hostname cdh02
hostnamectl set-hostname cdh03
hostnamectl set-hostname cdh04
hostnamectl set-hostname cdh05
hostnamectl set-hostname cdh06
hostnamectl set-hostname cdh07
hostnamectl set-hostname cdh08
hostnamectl set-hostname cdh09

1.2集群设置host

所有节点执行以下命令:
echo "10.83.68.150 cdh01">> /etc/hosts
echo "10.83.68.150 cdh02">> /etc/hosts
echo "10.83.68.150 cdh03">> /etc/hosts
echo "10.83.68.150 cdh04">> /etc/hosts
echo "10.83.68.150 cdh05">> /etc/hosts
echo "10.83.68.150 cdh06">> /etc/hosts
echo "10.83.68.150 cdh07">> /etc/hosts
echo "10.83.68.150 cdh08">> /etc/hosts
echo "10.83.68.150 cdh09">> /etc/hosts

1.3设置网络开启自启

vi /etc/sysconfig/network-scripts/ifcfg-eno3

1.4关闭selinux

所有节点执行以下 *** 作:
(1)修改配置文件
命令:vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled

(2)重启服务
命令:reboot

1.5设置免密登录

所有节点执行以下 *** 作:
(1)切换到root目录
命令:cd /root
(2)生成免密文件
命令:ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
(3)进行免密登录
依次执行以下命令,分别免密登录到cdh01、cdh02…:
ssh-copy-id cdh01
ssh-copy-id cdh02

ssh-copy-id cdh09

(4)测试免密登录是否成功
ssh cdh01(exit退出)

1.6关闭防火墙

所有节点执行以下命令:
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
#清空防火墙规则,正常一台新的服务器不需要执行以下命令
iptables -F

1.7配置ntp(时钟同步)

参考链接
(1)所有节点检查原有机器是否配有ntp
rpm -qa | grep ntp

(2)卸载原有节点的ntp
rpm -e ntpdate-4.2.6p5-28.el7.x86_64

(3)将ntp安装包上传到主节点,并发送到其它节点
scp /root/cdh6.3.1/ntp/* root@cdh02:/root/ntp
scp /root/cdh6.3.1/ntp/* root@cdh03:/root/ntp

scp /root/cdh6.3.1/ntp/* root@cdh08:/root/ntp
scp /root/cdh6.3.1/ntp/* root@cdh09:/root/ntp
(4)所有节点安装ntp
rpm -ivh ntpdate-4.2.....

(5)修改主节点config文件
命令:vi /etc/ntp.conf
配置文件添加以下内容:
server 127.127.1.0
Fudge 127.127.1.0 stratum 10
restrict 10.83.68.150 nomodify notrap nopeer noquery//当前节点IP地址
restrict 10.83.68.1 mask 255.255.255.0 nomodify notrap//集群所在网段的网关&子网掩码
注释掉以下内容:
#server 0…

#server3…
参考配置如下图:

(6)修改从节点config文件
命令:vi /etc/ntp.conf
配置文件添加以下内容:(告知服务器主节点是谁)
server 10.83.68.150//主节点ip
Fudge 10.83.68.150 stratum 10//主节点ip
restrict?10.83.68.150?nomodify notrap nopeer noquery ? ?//当前节点IP地址
restrict?10.83.68.1?mask?255.255.255.0?nomodify notrap ?//集群所在网段的网关&子网掩码
注释掉以下内容:
#server 0…

#server3…
参考配置如下图:

(7)所有节点启动ntp
命令:systemctl start ntpd
(8)所有节点和主节点时间同步
命令:ntpdate -u cdh01
(9)检测各节点时间是否一致
多窗口 *** 作,同时敲命令:date
(10)设置ntp开机自启
systemctl enable ntpd.service

1.8主节点上安装httpd服务

(1)上传rpm包到/root/cdh6.3.1/httpd

(2)进行安装
依次执行以下命令:
rpm -ivh apr-1.4.8-7.el7.x86_64.rpm
rpm -ivh postgresql-libs-9.2.24-4.el7_8.x86_64.rpm
rpm -ivh mailcap-2.1.41-2.el7.noarch.rpm
rpm -ivh apr-util-1.5.2-6.el7.x86_64.rpm
rpm -ivh apr-util-ldap-1.5.2-6.el7.x86_64.rpm
rpm -ivh httpd-tools-2.4.6-95.el7.centos.x86_64.rpm
rpm -ivh httpd-2.4.6-95.el7.centos.x86_64.rpm
(4)启动服务
命令:systemctl start httpd.service
(5)创建文件夹
先将CM6.3文件包上传到 /root/cdh6.3.1下面

命令:
cd /var/www/html/ (httpd服务安装成功后会自动生成该文件)
mkdir -p cm6/6.3.1/redhat7/yum/RPMS/x86_64/
(6)复制文件
命令:cp -r /root/cdh6.3.1/CM6.3/* cm6/6.3.1/redhat7/yum/RPMS/x86_64/
(7)上传allkeys.asc文件到/var/www/html/cm6/6.3.1/目录下
命令:cp cm6/6.3.1/redhat7/yum/RPMS/x86_64/allkeys.asc /var/www/html/cm6/6.3.1/
(8)访问测试
命令:Ip/cm6/6.3.1/redhat7/yum/RPMS/x86_64/

1.9生成repodata目录

主节点执行以下命令:
cd /var/www/html/cm6/6.3.1/redhat7/yum
createrepo .

1.10配置本地yum源

(1)主节点配置yum
命令:
cd /etc/yum.repos.d/
vim cloudera-manager.repo
填写:
[cloudera-manager]
name=Cloudera Manager
baseurl=http://cdh01/cm6/6.3.1/redhat7/yum/
gpgcheck=0
enabled=1
(2)将文件分发到各节点
scp /etc/yum.repos.d/cloudera-manager.repo root@cdh01:/etc/yum.repos.d/

scp /etc/yum.repos.d/cloudera-manager.repo root@cdh09:/etc/yum.repos.d/
(3)执行命令:
yum clean all (删除yum缓存,yum文件有更新后需执行此 *** 作)
yum list | grep cloudera (检查yum源配置有没有成功)

1.11安装JDK

(1)所有节点卸载centos自带的JDK
命令:
rpm -qa | grep java

(.noarch的文件是不可以删除的,其他文件均需删除)
执行删除 *** 作:
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.181-7.b13.el7.x86_64
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64
检查是否删除成功:
java -version
(2)上传JDK安装包到主节点
mkdir -p /usr/java

(3)解压
tar -zxvf jdk-8u202-linux-x64.tar.gz -C /usr/java
(4)配置主节点的环境变量
vi /etc/profile
添加以下内容:
export JAVA_HOME=/usr/java/jdk1.8.0_202/
export PATH= P A T H : PATH: PATH:JAVA_HOME/bin

(5)使主节点环境变量生效
source /etc/profile
(6)其他从节点依次执行主节点的 *** 作,安装JDK(可将主节点安装包和配置文件发送到各从节点)

1.12离线安装Mysql

参考链接
(1)上传mysql安装包到/root/cdh6.3.1/

(2)解压压缩包
命令:
cd /root/cdh6.3.1/Mysql5.7/
tar -xvf mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar
tar zxvf perl.tar.gz
tar zxvf net-tools.tar.gz
(3)卸载mariadb
命令:
rpm -qa|grep mariadb

rpm -e --nodeps mariadb-libs-5.5....
rpm -e --nodeps mariadb-server-5.5....
rpm -e --nodeps mariadb--5.5....
(4)离线包安装
命令:
cd /root/cdh6.3.1/Mysql5.7/perl
rpm -ivh *.rpm
cd /root/cdh6.3.1/Mysql5.7/net-tools
rpm -ivh net-tools-2.0-0.24.20131004git.el7.x86_64.rpm
cd /root/cdh6.3.1/Mysql5.7/
rpm -ivh mysql-community-common-5.7.27-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.27-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.27-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.27-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.27-1.el7.x86_64.rpm
rpm -ivh libaio-0.3.109-13.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.27-1.el7.x86_64.rpm
(5)关闭mysql服务
命令:service mysqld stop
(6)修改配置文件
命令:vi /etc/my.cnf
加入配置:skip-grant-tables

(7)开启mysql服务并登陆
命令:
service mysqld start
mysql -u root -p

(8)设置mysql密码
命令:
flush privileges;
set password for root@localhost = password(123456);
flush privileges;
exit
(9)停止mysql服务, 恢复mysql配置
命令:
service mysqld stop
vi /etc/my.cnf
注释掉skip-grant-tables
(10)启动mysql服务并验证
service mysqld start
mysql -u root -p
(11)开启外界访问权限
create database scm DEFAULT CHARACTER SET utf8;(创建数据库作为元数据库)
grant all PRIVILEGES on . TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
(该步骤可能会报密码过于简单的错误,只需要执行(12)“取消密码规范限制”的步骤即可)
grant all PRIVILEGES on . TO ‘root’@‘localhost’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
grant all PRIVILEGES on . TO ‘root’@‘cdh01’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
flush privileges;
(12)取消mysql密码规范限制
#set global validate_password_policy=0;
#set global validate_password_length=1;
#Flush privileges;
(13)设置开机自启
systemctl enable mysqld

1.13安装mysql的驱动

(1)上传驱动jar包到主节点cdh01

(2)分发到各从节点
scp mysql-connector-java.jar root@cdh01:/usr/share/java/

scp mysql-connector-java.jar root@cdh11:/usr/share/java/

1.14修改各个节点的系统配置文件

所有节点执行以下命令:
(1)调整内存交换配置
命令:echo ‘vm.swappiness=10’ >> /etc/sysctl.conf
(2)关闭Transparent Hugepages
命令:
echo never > /sys/kernel/mm/transparent_hugepage/defrag

   echo never > /sys/kernel/mm/transparent_hugepage/enabled

   echo 'echo never > /sys/kernel/mm/transparent_hugepage/defrag'  >> /etc/rc.local

   echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled'  >> /etc/rc.local

(3)修改Kernel Limits文件描述符(该步骤无需执行,后期报错再执行)
(文件描述符值建议设置为102400或更大。)
编辑/etc/security/limits.conf 文件,修改或调整nofile配置,如下:
命令:/etc/security/limits.conf
文档中添加内容:* - nofile 102400
上述命令同时配置了soft和hard类型的文件描述符,如果需要分开配置,配置方式如下:

  • soft nofile 102400
    * hard nofile 102400
2.安装CM服务 2.1上传所有服务rpm安装包到yum源目录下

命令:cd /var/www/html/cm6/6.3.1/redhat7/yum/RPMS/x86_64/

2.2安装server服务

执行以下命令:(yum源中有文件发生发生变化就需要执行以下 *** 作)
cd /var/www/html/cm6/6.3.1/redhat7/yum
createrepo .
yum clean all

所有节点安装以下服务:
yum install -y cloudera-manager-daemons.x86_64
yum install -y cloudera-manager-agent.x86_64
主节点安装以下服务:
yum install -y enterprise-debuginfo.x86_64
yum install -y cloudera-manager-server.x86_64
`yum install -y cloudera-manager-server-db-2.x86_64

2.3所有节点修改agent配置文件

2.4主节点设置元数据库为mysql

命令:/opt/cloudera/cm/schema/scm_prepare_database.sh -h localhost mysql scm root 123456
(提示ERROR JDBC Driver com.mysql.jdbc.Driver not found.需要上传mysql驱动包jar到/opt/cloudera/cm/lib目录下)

2.5主节点配置本地parcel包

上传cdh6的parcel等文件到/opt/cloudera/parcel-repo
命令:cd /opt/cloudera/parcel-repo

2.6主节点启动server服务进程

(查看7180端口)
命令:systemctl start cloudera-scm-server
设置服务开机自启:
systemctl enable cloudera-scm-server

2.7所有节点启动agent服务

命令:systemctl start cloudera-scm-agent
设置服务开机自启:
systemctl enable cloudera-scm-agent

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/3999316.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-10-22
下一篇 2022-10-22

发表评论

登录后才能评论

评论列表(0条)

保存