linux

CentOS 7 CDH 6.3.1 Cloudera Mana

2020-03-12  本文已影响0人  iDOKER

CDH 6.3.1 / Cloudera Manager6.3.1 CentOS 7 企业级离线安装 EZ 版

FileInfo
Filename - CDH 安装 EZ 版
Version - v1.2.2003(2020/03/02 ~ 2020/03/05)
Author - iDOKER
Email - shadowdoker@gmail.com
DescriptionKey - CDH install quick version

考虑到复制方便,就不开启禁止复制了,但:文章未经授权禁止转载

本文约定

在文中将有以下提示符对重点进行标注说明,请注意文中提示。

️ - 文中出现此标记,代表重要提示,指需要格外注意的地方

CDH 简单介绍

Cloudera Distribution including Apache Hadoop - CDH 为 Cloudera 的开源 Apache Hadoop 发行版,面向 Hadoop 企业级部署。
Cloudera版本(Cloudera’s Distribution Including Apache Hadoop,简称“CDH”),基于 Web 的用户界面,支持大多数 Hadoop 组件,包括 HDFS、MapReduce、Hive、Pig、Hbase、Zookeeper、Sqoop,简化了大数据平台的安装和使用难度。
除此 Apache Hadoop 发行版本之外,还有如下发行版:

组件介绍

Cloudera Manager 是用于管理 CDH 集群的端到端应用程序,统一管理和安装。CDH 除了可以通过 CM 安装也可以通过 YUM、TAR、RPM 安装。主要由如下几部分组成:

节点介绍

NAME NUMBER 描述
Server 1 CM 中 Manager 节点
Agent 1+N CM 中 其余 Node 节点

软件包准备

各节点需要安装:

Server节点需要安装:

CDH 安装需准备:

ALL 所有节点

systemctl stop firewalld
systemctl stop iptables
systemctl stop NetworkManager

systemctl disable firewalld
systemctl disable iptables
systemctl disable NetworkManager
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
hostnamectl set-hostname $HOSTNAME
vi /etc/hosts
# incloud itself
# 192.168.10.1 localhost localhost.localhost
echo "vm.swappiness=0" >>/etc/sysctl.conf && sysctl -p
echo "never" >/sys/kernel/mm/transparent_hugepage/defrag
echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
chmod +x /etc/rc.local
echo "never" >/sys/kernel/mm/transparent_hugepage/defrag" >>/etc/rc.local
echo "never" >/sys/kernel/mm/transparent_hugepage/enabled" >>/etc/rc.local
tail ‐2 /sys/kernel/mm/transparent_hugepage/defrag
tail ‐2 /sys/kernel/mm/transparent_hugepage/enabled
tail ‐2 /etc/rc.local

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

yum -y install ntp

server

# 管理节点使用本地时钟源,执行以下语句即可
cat <<EOF>/etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server 127.127.1.0 iburst
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
EOF

agent

# 其他节点的时钟源为管理节点,执行以下语句即可
cat <<EOF>/etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server node1  iburst
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
EOF

强制设置时间,写入硬件时钟

# 修改各节点时间,时间为当前时间
date -s "2020-04-16 23:11:07"
# 写入硬件时钟
hwclock -w

启动服务,并设置开机自启动

# 各节点启动服务
systemctl start ntpd && systemctl enable ntpd
# JDK 安装路径
mkdir -p /usr/local/java

若操作系统安装有 OpenJDK 则移除系统原有的 JDK

# 各节点都需要进行
# 查找JDK
rpm -aq|grep java
rpm -aq|grep jdk
# 卸载JDK
yum -y remove [上述查找结果的包名]

安装 Oracle JDK 1.8

# 在各节点上进行安装
# 创建java目录
mkdir /usr/java/
# 上传jdk目录下jdk-8u161-linux-x64.tar.gz到/usr/java目录 并解压
cd /usr/java/
tar -zxvf jdk-8u161-linux-x64.tar.gz
# ️ 修改 jdk 所属用户用户组
chown root:root jdk-8u161-linux-x64
# 配置环境变量
vi /etc/profile
# 在后面追加下面三行
export JAVA_HOME=/usr/java/jdk1.8.0_161
export CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=${JAVA_HOME}/bin:${PATH}
# 最后刷新环境变量
source /etc/profile
# 查看 Java 是否安装成功
java -version

Server 节点

若操作系统安装有 mariadb 则手工移除mariadb数据库
️ 亦可不移除,在安装 mysql 是会自动处理

  rpm -qa | grep mariadb
# 结果应为 mariadb-libs-5.5.56-2.el7.x86_64
# 卸载
  rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64

安装 MySql 服务

# 在 server 上安装 mysql 服务
# 上传repo目录下mysql-5.7.25-1.el7.x86_64.rpm-bundle.tar安装包到 /home/cdh/ 目录 并解压
  tar -xvf mysql-5.7.25-1.el7.x86_64.rpm-bundle.tar
# 进入解压目录 安装 mysql
  yum install net-tools
  rpm -ivh mysql-community-server-5.7.25-1.el7.x86_64.rpm mysql-community-client-5.7.25-1.el7.x86_64.rpm mysql-community-common-5.7.25-1.el7.x86_64.rpm mysql-community-libs-5.7.25-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.25-1.el7.x86_64.rpm

启动 mysql 服务,设置自启动

# 在 server上启动 mysql 服务,并设置自启动
  systemctl start mysqld
  systemctl enable mysqld

初始化 mysql 数据库

# 在node1 上初始化mysql
# 获得初始密码
  grep 'temporary password' /var/log/mysqld.log
# 使用初始密码登录
  mysql -u root -p
# 修改初始密码
  # show variables like 'validate_password%';# 查看密码验证策略
  set global validate_password_policy=0;# 设置密码验证策略为低
  set global validate_password_mixed_case_count=0;# 设置密码至少要包含的大小写字母个数
  set global validate_password_number_count=0;# 设置密码至少要包含的数字个数
  set global validate_password_special_char_count=0;# 设置密码至少要包含的特殊字符个数
  set global validate_password_length=3; # 设置密码最小长度为3
  ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
  grant all privileges on *.* to 'root'@'localhost' identified by '123456' with grant option;
  grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
  flush privileges;
  quit;
# 在各节点上执行
# 上传 repo 目录下 mysql 连接 mysql-connector-java-5.1.47.jar 到 /usr/share/java
  ️ mkdir -p /usr/share/java
# 重命名
  ️ mv mysql-connector-java-5.1.47.jar mysql-connector-java.jar
# 授权
  ️ chmod 777 mysql-connector-java.jar
  yum -y install cloudera-manager-agent cloudera-manager-daemons cloudera-manager-server
  ##执行数据库脚本
  cd /opt/cloudera/cm/schema
  ./scm_prepare_database.sh mysql -uroot -p scm scm scm
vi /etc/cloudera-scm-agent/config.ini
server_host=$SERVERHOSTNAME

Agent 节点

yum -y install cloudera-manager-agent cloudera-manager-daemo
vi /etc/cloudera-scm-agent/config.ini
server_host=$SERVERHOSTNAME

开始启动服务

server

systemctl start cloudera-scm-server
systemctl enable cloudera-scm-server
systemctl start cloudera-scm-agent
systemctl enable cloudera-scm-agent

agent

systemctl start cloudera-scm-agent
systemctl enable cloudera-scm-agent

网页操作

http://server:7180
默认用户名为 admin
默认密码为 admin

附录

组件建表语句

mysql -uroot -p123456

  ##给scm授权
  grant all privileges on *.* to 'scm'@'localhost' identified by 'scm' with grant option;
  grant all privileges on *.* to 'scm'@'%' identified by 'scm' with grant option;

  ##创建hive数据库
  create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

  ##给hive授权
  grant all privileges on *.* to 'hive'@'localhost' identified by 'hive' with grant option;
  grant all privileges on *.* to 'hive'@'%' identified by 'hive' with grant option;

  ##创建oozie数据库
  create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

  ##给oozie授权
  grant all privileges on *.* to 'oozie'@'localhost' identified by 'oozie' with grant option;
  grant all privileges on *.* to 'oozie'@'%' identified by 'oozie' with grant option;

  ##创建hue数据库
  create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

  ##给hub授权
  grant all privileges on *.* to 'hue'@'localhost' identified by 'hue' with grant option;
  grant all privileges on *.* to 'hue'@'%' identified by 'hue' with grant option;

  ##刷新权限
  flush privileges;

  ##退出
  quit;

附录结束

版本修订记录

版本号 修订日期 修订人 备注
v1.1.2003 2020-03-02 nuo 创建文档
v1.2.2003 2020-03-18 nuo agent 配置勘误
上一篇 下一篇

猜你喜欢

热点阅读