CDH5.9集群安装要点
一、用vmware安装1台linux虚拟机,后续直接克隆出多台虚拟机
1、采用centos 6.7 64位
2、为了节省固态硬盘空间,用最小化安装
二、linux虚拟机配置
1、修改hostname
hostname
vi /etc/sysconfig/network
vi /etc/hosts
2、关闭防火墙
service iptables status
service iptables stop
chkconfig iptables off
3、关闭SELinux
getenforce
vi /etc/selinux/config
SELINUX=disabled
4、配置网络
ip a
vi /etc/sysconfig/network-scripts/ifcfg-eth0
采用静态ip
DEVICE="eth0"
BOOTPROTO="static"
IPADDR=192.168.1.110
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
DNS1=8.8.8.8
DNS2=8.8.4.4
GATEWAY=192.168.1.1
5、安装jdk 1.8
rpm -qa | grep java
rpm -e --nodeps java-1.7.0-openjdk-devel-1.7.0.65-2.5.1.2.el6_5.x86_64
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.65-2.5.1.2.el6_5.x86_64
rpm -e --nodeps java-1.6.0-openjdk-devel-1.6.0.0-11.1.13.4.el6.x86_64
rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-11.1.13.4.el6.x86_64
rpm -e --nodeps java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
chmod 777 jdk-7u80-linux-x64.rpm
rpm -ivh jdk-8u102-linux-x64.rpm
配置JAVA_HOME
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_102
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
三、再完整克隆2台,修改克隆后的2台机器配置
1、修改hostname
hostname
vi /etc/sysconfig/network
vi /etc/hosts
2、修改网卡mac
ip a
vi /etc/sysconfig/network-scripts/ifcfg-eth1
四、ntp时间同步
rpm -qa | grep ntp
yum install ntp ntpdate
ntpdate cn.ntp.org.cn
五、安装配置mysql
yum install mysql
yum install mysql-server
yum install mysql-devel
数据库字符集设置
vi /etc/my.cnf
default-character-set=utf8
启动mysql服务
service mysqld start
或者
/etc/init.d/mysqld start
开机自启动
chkconfig --add mysqld
查看开机启动设置是否成功
chkconfig --list | grep mysql*
mysqld 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
创建root管理员
mysqladmin -u root password 123456
登录
mysql -u root -p123456。
允许远程登陆
mysql> use mysql;
mysql> select host,user,password from user;
mysql> update user set password=password('123456') where user='root';
mysql> update user set host='%' where user='root' and host='localhost';
mysql> flush privileges;
mysql> exit
update user set user='cdh' where host='%';
update user set password=password('123456') where user='cdh';
update user set user='cdh',password=password('123456') where host='localhost';
update user set password=password('123456') where user='root' and host='fk-storm-t01';
select host,user,password from user limit 4,5;
delete from user where host='fk-storm-t01'and user='';
delete from user where id = (select id from user limit 4,5); 删除第5行
创建如下数据库
hive数据库
create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
oozie数据库
create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
停止
service mysqld stop
六、安装
mkdir /opt/cloudera-manager
tar zxvf cloudera-manager-el6-cm5.9.0_x86_64.tar.gz -C /opt/cloudera-manager/
vi /opt/cloudera-manager/cm-5.9.0/etc/cloudera-scm-agent/config.ini
server_host=
cp mysql-connector-java-5.1.40-bin.jar /opt/cloudera-manager/cm-5.9.0/share/cmf/lib/
/opt/cloudera-manager/cm-5.9.0/share/cmf/schema/scm_prepare_database.sh -hcentos-3 -uroot -pmysql_123 mysql cm root mysql_123
mkdir -p /opt/cloudera/parcel-repo
chown root /opt/cloudera/parcel-repo
/opt/cloudera-manager/cm-5.9.0/etc/init.d/cloudera-scm-server start
/opt/cloudera-manager/cm-5.9.0/etc/init.d/cloudera-scm-agent start
scp -r /opt/cloudera-manager/cm-5.9.0 root@centos-2:/opt/cloudera-manager/cm-5.9.0
scp -r /opt/cloudera-manager/cm-5.9.0 root@centos-3:/opt/cloudera-manager/cm-5.9.0
/opt/cloudera-manager/cm-5.9.0/etc/init.d/cloudera-scm-server stop
/opt/cloudera-manager/cm-5.9.0/etc/init.d/cloudera-scm-agent stop
mv /opt/cloudera-manager/cloudera/parcel-repo/CDH-5.9.0-1.cdh5.9.0.p0.23-el6.parcel.sha1 /opt/cloudera-manager/cloudera/parcel-repo/CDH-5.9.0-1.cdh5.9.0.p0.23-el6.parcel.sha
mv /usr/lib/cmf/agent/build/env/bin/python /usr/lib/cmf/agent/build/env/bin/python.bak
cp mysql-connector-java-5.1.40-bin.jar /opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/
cp mysql-connector-java-5.1.40-bin.jar /opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/oozie/libext/
cp mysql-connector-java-5.1.40-bin.jar /usr/share/java/mysql-connector-java.jar