这篇文章是精通CDP系列的第一文章。
Cloudera与Hortonworks合并后,推出了全球领先的下一代数据平台Cloudera Data Platform。CDP为用户提供一个多云且多功能的平台,用于管理企业数据云。通过统一的平台界面,对数据进行整个生命周期管理,并提供一致的安全和治理服务。
Cloudera DataHub即CDH作为CDP的核心组件,集成了众多前沿数据技术,Ranger、Nifi、Flink、Ozone、Hive3,存储与计算分析,Cloudera Streams Management等等。这些我们会在系列文章中一一讲述。首先我们详细介绍下如何安装最新版CDH7.1.1。
前置准备
网络设置
修改网络IP,并设置为静态
代码语言:javascript复制vim /etc/sysconfig/network-scripts/ifcfg-ens192
主机名设置
使用hostnamectl set-hostname 修改主机名,配置/etc/hosts,并分发到所有节点
禁止Selinux
执行命令
代码语言:javascript复制./batch_cmd.sh node.list "setenforce 0"
关闭防火墙
代码语言:javascript复制./batch_cmd.sh node.list "systemctl disable firewalld"
./batch_cmd.sh node.list "systemctl status firewalld"
关闭透明大页面
使用脚本命令批量执行如下操作:
代码语言:javascript复制echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
设置开机自动关闭透明大页面:
代码语言:javascript复制echo "if test -f /sys/kernel/mm/transparent_hugepage/enabled; then">> /etc/rc.d/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled">> /etc/rc.d/rc.local
echo "fi">> /etc/rc.d/rc.local
echo "if test -f /sys/kernel/mm/transparent_hugepage/defrag; then">> /etc/rc.d/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag">> /etc/rc.d/rc.local
echo "fi">> /etc/rc.d/rc.local
授权:
使用脚本命令批量执行
代码语言:javascript复制./batch_cmd.sh node.list "cat /etc/rc.d/rc.local"
./batch_cmd.sh node.list "chmod x /etc/rc.d/rc.local"
./batch_cmd.sh node.list "ls -l /etc/rc.d/|grep rc.local"
设置swappiness
代码语言:javascript复制sysctl vm.swappiness=30
echo 10> /proc/sys/vm/swappiness
查看swappiness的值:
代码语言:javascript复制./batch_cmd.sh node.list "cat /proc/sys/vm/swappiness"
安装ntp时间同步
所有节点下载安装ntp服务
使用脚本批量执行
代码语言:javascript复制./batch_cmd.sh node.list "yum -y install ntp"
Master节点修改 /etc/ntp.conf文件:
注释部分内容,添加以下内容:
代码语言:javascript复制server 127.127.1.0
fudge 127.127.1.0 stratum 10
集群其他节点修改/etc/ntp.conf文件如下:
启动ntpd服务,并设置ntpd服务开机自动启动,查看ntp服务状态:
查看同步状态:
安装httpd
启动httpd,并设置开机自动启动,查看httpd状态
配置Cloudera Manager的repo源
在/etc/yum.repos.d/目录下新建cm.repo文件,并添加如下内容:
执行
代码语言:javascript复制yum clean all
yum repolist
安装数据库
代码语言:javascript复制yum -y install mariadb mariadb-server
启动mariadb数据库:systemctl start mariadb
设置mariadb数据库开机自启:systemctl enable mariadb
查看mariadb数据库服务状态:systemctl status mariadb
配置mariadb,设置密码为password
代码语言:javascript复制/usr/bin/mysql_secure_installation
创建集群所需的数据库
代码语言:javascript复制create database metastore default character set utf8;
CREATE USER 'hive'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON metastore.* TO 'hive'@'%';
FLUSH PRIVILEGES;
create database cm default character set utf8;
CREATE USER 'cm'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON cm.* TO 'cm'@'%';
FLUSH PRIVILEGES;
create database rm default character set utf8;
CREATE USER 'rm'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON rm.* TO 'rm'@'%';
FLUSH PRIVILEGES;
create database am default character set utf8;
CREATE USER 'am'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON am.* TO 'am'@'%';
FLUSH PRIVILEGES;
create database hue default character set utf8;
CREATE USER 'hue'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON hue.* TO 'hue'@'%';
FLUSH PRIVILEGES;
create database oozie default character set utf8;
CREATE USER 'oozie'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';
FLUSH PRIVILEGES;
create database nav_ms default character set utf8;
CREATE USER 'nav_ms'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nav_ms. * TO 'nav_ms'@'%';
FLUSH PRIVILEGES;
create database nav_as default character set utf8;
CREATE USER 'nav_as'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nav_as. * TO 'nav_as'@'%';
FLUSH PRIVILEGES;
create database ranger default character set utf8;
CREATE USER 'rangeradmin'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON ranger. * TO 'rangeradmin'@'%';
FLUSH PRIVILEGES;
查看创建的数据库:
安装JDBC驱动
创建/usr/share/java/文件夹,并将驱动jar包改名为:mysql-connector-java.jar放进该目录:
在master节点上安装JDK
集群的部署安装
安装并启动cloudera-manager-server
在master节点上安装Cloudera-Manager-Server:
代码语言:javascript复制yum -y install cloudera-manager-server
初始化数据库
代码语言:javascript复制/opt/cloudera/cm/schema/scm_prepare_database.sh mysql cm cm password
执行启动命令
代码语言:javascript复制systemctl start cloudera-scm-server
查看7180端口是否被监听
代码语言:javascript复制netstat -lnpt|grep 7180
登录
通过网页访问 http://192.168.0.234:7180/cmf/login
输入账号admin 密码 admin登录CM