Java 杂谈CDH的安装和操作

CDH在线安装详细步骤(使用官方yum源)

2018-09-20  本文已影响8人  其实我很dou

CDH在线安装

在线安装过程不算太过复杂, 需要细心

一. 安装前准备

10.30.5.160 dev-uar-jmeter-01
10.30.5.161 dev-uar-jmeter-02
10.30.5.162 dev-uar-jmeter-03
10.30.5.163 dev-uar-jmeter-04
su - uar
ssh-keygen
ssh-copy-id dev-uar-jmeter-01 (同步公钥)
ssh-copy-id dev-uar-jmeter-02
ssh-copy-id dev-uar-jmeter-03
ssh-copy-id dev-uar-jmeter-04
/etc/init.d/iptables stop && chkconfig iptables off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && setenforce 0
yum install ntp
chkconfig ntpd on
ntpdate -u ntp.sjtu.edu.cn

# 添加crontab
*/2 * * * * /usr/sbin/ntpdate -u ntp.sjtu.edu.cn >> /dev/null 2>&1


#楼主java_home是这个目录
echo $JAVA_HOME
/usr/local/java/jdk1.7.0_80

#生成软链
mkdir /usr/java 
ln -s /usr/local/java/jdk1.7.0_80 /usr/java/default
create database cmf DEFAULT CHARACTER SET utf8
GRANT ALL PRIVILEGES ON cmf.* TO 'cmf'@'%' IDENTIFIED BY 'cmf123456'

二. 设置yum源(非常重要)

cd /etc/yum.repos.d/
wget http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/cloudera-manager.repo
wget https://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/cloudera-cdh5.repo

假如我想安装5.7.0, 需要做如下操作
打开一下两个网址查找是否有5.7.0文件夹, 如果有, 才能安装5.7.0版本, 否则, 选择其他版本
http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/
http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/

cdh-2.png

三. 安装并配置CDH-server

com.cloudera.cmf.db.type=mysql

# The database host
# If a non standard port is needed, use 'hostname:port'
com.cloudera.cmf.db.host=10.30.5.167:3306

# 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=cmf123456

wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz

#解压后,将其jar包复制到cdh公共lib目录下 
mv mysql-connector-java-5.1.47-bin.jar mysql-connector-java.jar
cp mysql-connector-java.jar /usr/share/cmf/lib/
cp mysql-connector-java.jar /usr/share/cmf/common_jars/
cp mysql-connector-java.jar $JAVA_HOME/lib/

四. 界面配置CDH

安装agent 楼主心得:

BEGIN host -t PTR 10.30.5.160 
160.5.30.10.in-addr.arpa domain name pointer bogon. 
END (0) 
using bogon as scm server hostname 
BEGIN which python

需要在各失败的agent机器上执行mv /usr/bin/host /usr/bin/host.bak

五. CDH卸载

楼主由于安装时没有修改yum源, 只是cdh版本太高, 和应用不兼容, 所以需要卸载cdh并安装低版本5.7.0

卸载步骤:

yum remove clouder* -y
yum clean all
find / -name clouder* | xargs rm -rf
find / -name cmf* | xargs rm -rf 

cd /var/lib/
rm -rf flume-ng/ hadoop-* oozie/ solr/ sqoop* zookeeper
rm -rf hbase hive impala kudu llama sentry spark

进入根目录, 查看是否有dfs, yarn等目录, 将其删掉
rm -rf /dfs /yarn......

参考博客: https://blog.csdn.net/wh211212/article/details/78743191

上一篇下一篇

猜你喜欢

热点阅读