概述
文章目录
- 一、主机
- 二、准备安装包
- 2.1 MySQL 5.7.27
- 2.2 MySQL驱动
- 2.3 cloudera-manager包
- 2.4 parcel数据包
- 2.5 目录树
- 三、初始化主机环境
- 3.1 设置主机名
- 3.2 关闭防火墙和Selinux
- 3.3 启动NTP服务
- 四、安装
- 4.1 搭建本地yum源
- 4.2 安装jdk
- 4.3 安装MySQL
- 4.4 安装Cloudera Manager
- 4.5 配置本地Parcel存储库
- 4.6 初始化scm库
- 4.7 启动CM
- 五、初始化CM
- 六、后续优化
官网文档
一、主机
服务器的运行内存还是不要太小,很多服务例如 Impala
、Spark
特别吃内存。如果上线生产环境,推荐 128G
保底。
主机 | IP | 内存 | 硬盘 |
---|---|---|---|
master | 192.168.0.31 | 16G | 500G |
tools | 192.168.0.32 | 16G | 500G |
gateway | 192.168.0.33 | 16G | 500G |
worker | 192.168.0.34 | 16G | 500G |
主机角色划分
- master
安装例如 HDFS
的 NameNode
、Hbase
的 Master server
、YARN
的 ResourceManager
等比较重要的组件。
- tools
安装例如CM
、Hue
、Sqoop
等工具辅助类组件。
- gateway
安装例如 HDFS
的 JournalNode
、Hbase
的 HBase REST Server
等集群间通讯类组件。
- worker
安装例如 HDFS
的 DataNode
、Hbase
的 RegionServer
、Kudu
的 tablet
等用来存储数据的工作组件。
二、准备安装包
2.1 MySQL 5.7.27
mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar
2.2 MySQL驱动
mysql-connector-java-5.1.47.tar.gz
2.3 cloudera-manager包
cloudera-manager-agent-6.3.0-1281944.el7.x86_64.rpm
cloudera-manager-daemons-6.3.0-1281944.el7.x86_64.rpm
cloudera-manager-server-6.3.0-1281944.el7.x86_64.rpm
cloudera-manager-server-db-2-6.3.0-1281944.el7.x86_64.rpm
enterprise-debuginfo-6.3.0-1281944.el7.x86_64.rpm
oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
allkeys.asc
2.4 parcel数据包
CDH-6.3.0-1.cdh6.3.0.p0.1279813-el7.parcel
manifest.json
其他版本下载地址:https://archive.cloudera.com/cdh6/
2.5 目录树
将这些安装包上传到 tools
主机上
[root@localhost ~]# tree -C cloudera/
cloudera/
├── cloudera-manager
│ ├── allkeys.asc
│ ├── cloudera-manager-agent-6.3.0-1281944.el7.x86_64.rpm
│ ├── cloudera-manager-daemons-6.3.0-1281944.el7.x86_64.rpm
│ ├── cloudera-manager-server-6.3.0-1281944.el7.x86_64.rpm
│ ├── cloudera-manager-server-db-2-6.3.0-1281944.el7.x86_64.rpm
│ ├── enterprise-debuginfo-6.3.0-1281944.el7.x86_64.rpm
│ └── oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
├── mysql
│ └── mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar
├── mysql-jdbc
│ └── mysql-connector-java-5.1.47.tar.gz
└── parcel
├── CDH-6.3.0-1.cdh6.3.0.p0.1279813-el7.parcel
└── manifest.json
4 directories, 11 files
三、初始化主机环境
先安装一些基本工具
yum install -y vim wget ntp net-tools
3.1 设置主机名
给四台主机分别设置主机名
hostnamectl set-hostname master.cdh
hostnamectl set-hostname tools.cdh
hostnamectl set-hostname gateway.cdh
hostnamectl set-hostname worker.cdh
每台主机修改 /etc/hosts
文件,追加
192.168.0.31 master.cdh
192.168.0.32 tools.cdh
192.168.0.33 gateway.cdh
192.168.0.34 worker.cdh
修改每台主机的 /etc/sysconfig/network
文件,分别追加
HOSTNAME=master.cdh
HOSTNAME=tools.cdh
HOSTNAME=gateway.cdh
HOSTNAME=worker.cdh
使用 uname -a && hostname
命令查看主机名
3.2 关闭防火墙和Selinux
每台主机关闭防火墙
systemctl stop firewalld
&& systemctl disable firewalld
&& systemctl status firewalld
每台主机关闭Selinux
setenforce 0 #临时关闭
vim /etc/selinux/config #永久关闭
# SELINUX=enforcing 改成 SELINUX=permissive
getenforce #查看状态为Permissive
3.3 启动NTP服务
关闭 chrony
服务,该服务会影响到NTP服务的开机启动
systemctl stop chronyd && systemctl disable chronyd
设置NTP服务
vim /etc/ntp.conf
# 将时钟服务器更改为如下4个
server 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org
启动时间同步服务器
systemctl start ntpd
&& systemctl enable ntpd
&& ntpdate -u 0.cn.pool.ntp.org
&& hwclock --systohc
&& date
四、安装
在 tools
主机上操作
4.1 搭建本地yum源
yum -y install httpd createrepo
&& systemctl start httpd
&& systemctl enable httpd
&& cd /root/cloudera/cloudera-manager/
&& createrepo .
&& mv /root/cloudera/cloudera-manager/ /var/www/html/
访问:http://192.168.0.32/cloudera-manager/
4.2 安装jdk
cd /var/www/html/cloudera-manager/;rpm -ivh oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
4.3 安装MySQL
卸载自带的 mariadb
yum -y remove mariadb-libs
解压下载的 MySQL
包
cd /root/cloudera/mysql/;tar -xvf mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar
安装 MySQL
yum install -y libaio
&& 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-client-5.7.27-1.el7.x86_64.rpm
&& rpm -ivh mysql-community-server-5.7.27-1.el7.x86_64.rpm
&& rpm -ivh mysql-community-libs-compat-5.7.27-1.el7.x86_64.rpm
配置 my.cnf
echo character-set-server=utf8 >> /etc/my.cnf
数据库授权
(
cat <<EOF
set password for root@localhost = password('123456Aa.');
grant all privileges on *.* to 'root'@'%' identified by '123456Aa.';
flush privileges;
CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON scm.* TO 'scm'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON amon.* TO 'amon'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON rman.* TO 'rman'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON hue.* TO 'hue'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON metastore.* TO 'hive'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON sentry.* TO 'sentry'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON nav.* TO 'nav'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON navms.* TO 'navms'@'%' IDENTIFIED BY '123456Aa.';
GRANT ALL ON oozie.* TO 'oozie'@'%' IDENTIFIED BY '123456Aa.';
SHOW DATABASES;
EOF
) >> /root/c.sql
启动 MySQL
systemctl enable mysqld && systemctl start mysqld && grep password /var/log/mysqld.log | sed 's/.*(............)$/1/'
执行脚本
[root@tools ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.7.27
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> source /root/c.sql
Query OK, 0 rows affected, 1 warning (0.00 sec)
配置 mysql jdbc
驱动
mkdir -p /usr/share/java/
&& cd /root/cloudera/mysql-jdbc/;tar -zxvf mysql-connector-java-5.1.47.tar.gz
&& cp /root/cloudera/mysql-jdbc/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/share/java/mysql-connector-java.jar
4.4 安装Cloudera Manager
tools
主机配置本地 yum
源
(
cat <<EOF
[cloudera-manager]
name=Cloudera Manager 6.3.0
baseurl=http://192.168.0.32/cloudera-manager/
gpgcheck=0
enabled=1
EOF
) >> /etc/yum.repos.d/cloudera-manager.repo
&& yum clean all
&& yum makecache
安装 Cloudera Manager
yum install -y cloudera-manager-daemons cloudera-manager-agent cloudera-manager-server
4.5 配置本地Parcel存储库
mv /root/cloudera/parcel/* /opt/cloudera/parcel-repo
cd /opt/cloudera/parcel-repo/
sha1sum CDH-6.3.0-1.cdh6.3.0.p0.1279813-el7.parcel | awk '{ print $1 }' > CDH-6.3.0-1.cdh6.3.0.p0.1279813-el7.parcel.sha
chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/*
4.6 初始化scm库
执行 scm_prepare_database.sh
脚本
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm 123456Aa.
4.7 启动CM
systemctl start cloudera-scm-server
&& sleep 2
&& tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log | grep "INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server"
出现INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server
则启动成功
访问 http://192.168.0.32:7180
账号密码为 admin/admin
五、初始化CM
欢迎界面,下一步
用户许可,同意,下一步
选择试用版60天到期,不用白不用,下一步
欢迎界面,下一步
设置集群名称,下一步
选择网络中的主机,下一步
输入本地 yum
源地址,下一步
同意 jdk
使用许可,下一步
输入其他主机密码,下一步
每台主机安装 agent
,安装完毕,下一步
安装 Parcels
包,安装完毕,下一步
主机健康检查,下一步,报错解决方法 https://blog.csdn.net/qq_39680564/article/details/100013275
选择安装的服务,下一步
自行分配角色至主机,下一步
测试数据库链接,下一步
配置实例的安装位置,数据目录尽量安装在大的分区下
安装服务,下一步
安装完成
六、后续优化
Hive
设置:https://blog.csdn.net/qq_39680564/article/details/101015864
Spark
设置:https://blog.csdn.net/qq_39680564/article/details/101209640
root
权限:https://blog.csdn.net/qq_39680564/article/details/101216414
最后
以上就是现代金针菇为你收集整理的CDH6.3集群部署--研发环境安装实录一、主机二、准备安装包三、初始化主机环境四、安装五、初始化CM六、后续优化的全部内容,希望文章能够帮你解决CDH6.3集群部署--研发环境安装实录一、主机二、准备安装包三、初始化主机环境四、安装五、初始化CM六、后续优化所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复