Skip to content

安装前环境准备

  1. 关闭防火墙
shell
sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo systemctl status firewalld
  1. 修改文件句柄数

修改 /etc/security/limits.conf 文件

shell
#限制单个进程最大文件句柄数(到达此限制时系统报警)  
* soft nofile 65536 

#限制单个进程最大文件句柄数(到达此限制时系统报错)
* hard nofile 65536
  1. 关闭 Swap

不停机执行:

sysctl -w vm.max_map_count=262144

编辑 /etc/sysctl.conf 添加如下内容后重启服务器:

vim /etc/sysctl.conf

shell
vm.swappiness=0

vm.max_map_count=262144
  1. 关闭 selinux

vim /etc/selinux/config

shell
SELINUX=disabled 
# SELINUX=enforcing
# SELINUX=disabled 

reboot
  1. 免密登录

Linux 免密登录

shell
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

# 验证
ssh localhost/ip/hostname

安装JDK

下载 JDK:

shell
wget http://10.10.26.36:8080/files/CDH/6.3.1/redhat7/oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm

安装 JDK:

shell
rpm -Uvh oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm --nodeps --force

配置环境变量:

shell
export JAVA_HOME="/usr/java/jdk1.8.0_181-cloudera"
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

开始安装

创建 yum 软件仓库

shell
yum install createrepo
createrepo .


rpm -ivh *.rpm --nodeps --force

数据库驱动:

mkdir -p /usr/share/java chmod 755 /usr/share/java cp -v mysql-connector-java.jar /usr/share/java/mysql-connector-java.jar

vim /etc/cloudera-scm-server/db.properties

properties
# Currently 'mysql', 'postgresql' and 'oracle' are valid databases.
com.cloudera.cmf.db.type=mysql
    
# The database host
# If a non standard port is needed, use 'hostname:port'
com.cloudera.cmf.db.host=cdh-server01
    
# The database name
com.cloudera.cmf.db.name=cmf
    
# The database user
com.cloudera.cmf.db.user=cmf
    
# The database user's password
com.cloudera.cmf.db.password=ahu=2018
    
# The db setup type
# If scm-server uses External DB then it is set to EXTERNAL
com.cloudera.cmf.db.setupType=EXTERNAL

CDH 初始化:

shell
/opt/cloudera/cm/schema/scm_prepare_database.sh --host db_host --port db_port mysql dbname username primeton000000

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