CDH搭建

改主机名


hostnamectl set-hostname cdh-node01

ssh配置免密登录


ssh-keygen -t rsa
ssh-copy-id cdh-node01

安装jdk :vim /etc/profile


#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_211
export PATH=$PATH:$JAVA_HOME/bin

添加shell分发脚本/root/bin


#!/bin/bash
#1 获取输入参数个数,如果没有参数,直接退出
pcount=$#
if ((pcount==0)); then
echo no args;
exit;
fi

#2 获取文件名称
p1=$1
fname=`basename $p1`
echo fname=$fname

#3 获取上级目录到绝对路径
pdir=`cd -P $(dirname $p1); pwd`
echo pdir=$pdir

#4 获取当前用户名称
user=`whoami`

#5 循环
for((host=1; host<4; host++)); do
        echo ------------------- cdh-node0$host --------------
        rsync -av $pdir/$fname $user@cdh-node0$host:$pdir
done

离线安装配置mysql


#查看是否安装mysql
rpm -qa|grep -i mysql
#如果安装了卸载
rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64
#卸载aliyun mysql依赖
yum remove mysql-libs
#安装依赖
yum install libaio
yum -y install autoconf
wget https://downloads.mysql.com/archives/get/p/23/file/MySQL-shared-compat-5.6.24-1.el6.x86_64.rpm
wget https://downloads.mysql.com/archives/get/p/23/file/MySQL-shared-5.6.24-1.el7.x86_64.rpm
rpm -ivh MySQL-shared-5.6.24-1.el7.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.6.24-1.el6.x86_64.rpm
#解压mysql-libs
yum install unzip
unzip mysql-libs.zip
#安装
rpm -ivh MySQL-server-5.6.24-1.el6.x86_64.rpm
#密码
cat /root/.mysql_secret
OEXaQuS8IWkG19Xs
#查看mysql状态
service mysql status
#启动mysql服务
service mysql start
#安装mysql客户端
rpm -ivh MySQL-client-5.6.24-1.el6.x86_64.rpm
#登录
mysql -uroot -pOEXaQuS8IWkG19Xs
#修改密码
SET PASSWORD=PASSWORD('000000');
#配置登录
mysql>use mysql;
mysql>select User, Host, Password from user;
mysql>update user set host='%' where host='localhost';
mysql> delete from user where host!='%';
mysql>flush privileges;
#创建CDH的元数据库和⽤用户、amon服务的数据库及⽤用户
create database cmf DEFAULT CHARACTER SET utf8;
create database amon DEFAULT CHARACTER SET utf8;
grant all on cmf.* TO 'cmf'@'%' IDENTIFIED BY 'www.ruozedata.com';
grant all on amon.* TO 'amon'@'%' IDENTIFIED BY 'www.ruozedata.com';
flush privileges;

mysql jdbc jar


cp mysql-connector-java-5.1.47.jar  /usr/share/java/mysql-connector-java.jar

cdh部署


#所有节点创建⽬目录及解压
mkdir /opt/cloudera-manager
tar -xzvf cm6.3.1-redhat7.tar.gz -C /opt/cloudera-manager/
#001部署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
所有节点部署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
#所有节点修改agent的配置,指向server的节点001
vim /etc/cloudera-scm-agen t/config.ini
改server_host=hzwnode01
#主节点修改server的配置:
vim /etc/cloudera-scm-server/db.properties
com.cloudera.cmf.db.type=mysql
com.cloudera.cmf.db.host=ruozedata001
com.cloudera.cmf.db.name=cmf
com.cloudera.cmf.db.user=cmf
com.cloudera.cmf.db.password=******
com.cloudera.cmf.db.setupType=EXTERNAL

部署离线parcel源


#安装httpd服务
yum install -y httpd
#部署离线parcel源
mkdir -p /var/www/html/cdh6_parcel
cp  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/

#启动httpd
systemctl start httpd

启动节点


#server节点
systemctl start cloudera-scm-server
service cloudera-scm-server status
#所有agent节点
systemctl start cloudera-scm-agent
service cloudera-scm-agent status
CDH搭建

发表评论

电子邮件地址不会被公开。 必填项已用*标注

滚动到顶部