配置静态IP

  1. vi /etc/sysconfig/network-scripts/ifcfg-ens34
  2. static
  3. IPADDR=11.11.11.20
  4. NETMASK=255.255.255.0
  5. GATEWAY=11.11.11.254

配置yum源

  1. cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  2. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  3. yum clean all
  4. yum makecache

环境配置

  • 修改hostname

    1. vi /etc/hostname
  • 修改hosts

    1. vi /etc/hosts
  • 关闭防火墙

    1. systemctl stop firewalld
    2. systemctl disable firewalld
    3. systemctl status firewalld
  • 关闭selinux

    1. sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
  • 安装依赖

    1. yum install -y bind-utils libxslt cyrus-sasl-plain cyrus-sasl-gssapi portmap fuse-libs /lib/lsb/init-functions httpd mod_ssl openssl-devel python-psycopg2 Mysql-python fuse
  • 免密登录

    1. ssh-keygen
    2. ssh-copy-id cdh01
  • 调整大页

    1. echo never > /sys/kernel/mm/transparent_hugepage/defrag
    2. echo never > /sys/kernel/mm/transparent_hugepage/enabled
    3. echo 'vm.swappiness=10'>> /etc/sysctl.conf
  • 安装jdk ```bash yum install -y oracle-j2sdk1.8.x86_64

环境变量

add for JAVA_HOME

export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera/ export PATH=$JAVA_HOME/bin:$PATH

  1. - 相关依赖
  2. ```bash
  3. yum install -y bind-utils libxslt cyrus-sasl-plain cyrus-sasl-gssapi portmap fuse-libs /lib/lsb/init-functions httpd mod_ssl openssl-devel python-psycopg2 Mysql-python fuse ntp

克隆cdh02 03

配置CM源

#cdh01

yum install -y httpd
yum install -y cloudera-manager-agent cloudera-manager-daemons cloudera-manager-server cloudera-manager-server-db-2 postgresq-server
yum install -y mariadb-server

systemctl enable httpd
systemctl enable httpd

#http改端口
vi /etc/httpd/conf/httpd.conf
Listen 6789

yum install -y createrepo
cd /var/www/html/cm6
createrepo .

#配置yum源 cdh01 cdh02 chd03
cat >> /etc/yum.repos.d/cm.repo << EOF
[CM]
name=cm6
baseurl=http://cdh01/cm6/
gpgcheck=0
EOF

yum clean all
yum repolist


#上传cm6 cdh6 和mysql-connect-to-java.jar
cd /var/www/html/

#将jar 移动到 /usr/share/java/
mv mysql-connector-java-5.1.34.jar /usr/share/java/mysql-connector-java.jar


systemctl start mariadb && systemctl enable mariadb
mysql_secure_installation //设置密码shdata
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql -h localhost -uroot -pshdata --scm-host localhost scm root root


#数据库配置

mysql -uroot -proot

create database hive default charset utf8;
create user 'hive'@'%' identified by '123456';
grant all on hive.* TO 'hive'@'%' identified by '123456';
flush privileges;

create database oozie default charset utf8;
create user 'oozie'@'%' identified by '123456';
grant all on oozie.* TO 'oozie'@'%' identified by '123456';
flush privileges;

create database hue default charset utf8;
create user 'hue'@'%' identified by '123456';
grant all on hue.* TO 'hue'@'%' identified by '123456';
flush privileges;

create database reports default charset utf8;
create user 'reports'@'%' identified by '123456';
grant all on reports.* to 'reports'@'%' identified by '123456';
flush privileges;


#cdh02 cdh03

yum install cloudera-manager-daemons cloudera-manager-agent -y

# cdh01 cdh02 chd03
sed -i "s/server_host=localhost/server_host=cdh01/g" /etc/cloudera-scm-agent/config.ini

启动开机自启

#cdh01
systemctl start cloudera-scm-server
systemctl enable cloudera-scm-server

#cdh01 02 03
systemctl start cloudera-scm-agent
systemctl enable cloudera-scm-agent

Web配置

http://cdh01:7180

远程parcel存储库url填写[http://cdh01](http://cdh01:7180)/cdh6/

选择对应的cdh版本即可