配置静态IP
vi /etc/sysconfig/network-scripts/ifcfg-ens34staticIPADDR=11.11.11.20NETMASK=255.255.255.0GATEWAY=11.11.11.254
配置yum源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoyum clean allyum makecache
环境配置
修改hostname
vi /etc/hostname
修改hosts
vi /etc/hosts
关闭防火墙
systemctl stop firewalldsystemctl disable firewalldsystemctl status firewalld
关闭selinux
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
安装依赖
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
免密登录
ssh-keygenssh-copy-id cdh01
调整大页
echo never > /sys/kernel/mm/transparent_hugepage/defragecho never > /sys/kernel/mm/transparent_hugepage/enabledecho '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
- 相关依赖```bashyum 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配置
远程parcel存储库url填写[http://cdh01](http://cdh01:7180)/cdh6/
选择对应的cdh版本即可
