你的位置:首页 > 数据库

[数据库]centos7安装CDH5.5.0


1、安装jdk

mkdir -p /usr/java
tar zxvf jdk-7u80-linux-x64.tar.gz -C /usr/java/

vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_80
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
source /etc/profile

alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_80/bin/java 1
alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_80/bin/javac 1
alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_80/bin/jar 1
alternatives --install /usr/bin/javap javadoc /usr/java/jdk1.7.0_80/bin/javadoc 1
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_80/bin/javaws 1
alternatives --config java

2、ssh配置

server和servant:
ssh-keyget -t rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
cp id_rsa.pub id_rsa_server.pub

拷贝pub到servant
scp id_rsa_server.pub root@h104:~/.ssh/
cat ~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
错误调试采用 tail secure -n 20

3、关闭防火墙 root账户

systemctl stop firewalld.service
systemctl disable firewalld.service

4、修改/etc/selinux/config 下的 SELINUX=disabled (重启后生效)

SELINUX=disabled

5、安装NTP服务

su root
yum install -y ntp
yum install -y ntpdate
vi /etc/ntp.conf
主要修改restrict 和ntp server 具体百度
systemctl start ntpd
systemctl enable ntpd

ntpdate -u pool.ntp.org
ntpdate -u h104

6、安装mysql

rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-server
systemctl start mysqld.service
systemctl enable mysqld.service
mysql -u root
use mysql;
update user set password=password('123456') where user='root';
grant all on *.* to root@"%" Identified by '123456';
flush privileges;

7、cm和cdh安装的准备工作

1)解压压缩包到/opt
tar zxvf cloudera-manager-centos7-cm5.5.0_x86_64.tar.gz -C /opt
2)拷贝parcel包到/opt/cloudera/parcel-repo
sudo cp /usr/local/software/CDH-5.5.0-1.cdh5.5.0.p0.8-el7.parcel.sha1 /opt/cloudera/parcel-repo/CDH-5.5.0-1.cdh5.5.0.p0.8-el7.parcel.sha

sudo cp /usr/local/software/manifest.json /opt/cloudera/parcel-repo

sudo cp /usr/local/software/CDH-5.5.0-1.cdh5.5.0.p0.8-el7.parcel /opt/cloudera/parcel-repo
3)修改server_host
vi /opt/cm-5.5.0/etc/cloudera-scm-agent/config.ini
server_host=
4)创建用户cloudera-scm
useradd --system --home=/opt/cm-5.5.0/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
5)Cloudera Manager 5.5建立数据库
/opt/cm-5.5.0/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -p123456 --scm-host localhost scm scm scm

需要拷贝jdbc驱动
cp /usr/local/software/mysql-connector-java-5.1.38-bin.jar /opt/cm-5.5.0/share/cmf/lib/

6)创建其它需要的数据库
数据名取组件头两个字母或者全名如:hive os(oozie server)
create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

create database am DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

create database rm DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

create database os DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

8、备份系统

东西准备好了要备份系统,安装失败,可以还原
tar cvpzf backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys
tar cvpjf backup.tar.bz2 / --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.bz2 --exclude=/mnt --exclude=/sys
还原的语句
tar xvpfz backup.tgz -C /
tar xvpfj backup.tar.bz2 -C /
9、启动server
sudo /opt/cm-5.5.0/etc/init.d/cloudera-scm-server start
10、启动agent
scp -r /opt/cm-5.5.0 root@h103:/opt
sudo /opt/cm-5.5.0/etc/init.d/cloudera-scm-agent start

11、开始安装

12、java驱动找不到的问题解决

scp mysql-connector-java-5.1.38-bin.jar root@h103:/opt/cloudera/parcels/CDH/lib/hive/lib/

scp mysql-connector-java-5.1.38-bin.jar root@h103:/opt/cloudera/parcels/CDH/lib/hive/lib/

scp mysql-connector-java-5.1.38-bin.jar root@h103:/opt/cloudera/parcels/CDH/lib/oozie/lib/