CDH安装笔记

原创
2017/01/18 00:16
阅读数 388

系统环境准备

1、网络配置

vi /etc/sysconfig/network

vi /etc/hosts

 

2、ssh免密钥登录

ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

scp /etc/hosts node3:/etc/

cat /tmp/id_dsa.pub >> authorized_keys

 

3、防火墙关闭

service iptables stop

chkconfig iptables off

 

4、SELINUX关闭

setenforce 0

vi /etc/selinux/config (SELINUX=disabled)

 

5、安装JDK配置环境变量

vi /etc/profile

export JAVA_HOME=/opt/jdk

export PATH=$PATH:$JAVA_HOME/bin:

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

 

6、安装NTP

设置开机启动 chkconfig ntpd on

设置时间同步

ntpdate -u s2m.time.edu.cn或ntpdate -u time.nist.gov

 

7、安装配置mysql(在server机器上安装mysql)

yum install mysql-server

service mysqld start

chkconfig mysqld on

chkconfig --list mysqld

use mysql;

select host, user from user;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;

delete from user where host != '%';

flush privileges;

 

8、下载第三方依赖包

yum install chkconfig python bind-util psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb -y

 

node1 server
agent
mysql 依赖包
node2 agent   依赖包
node3 agent   依赖包

 

CM安装

1、COPY文件

mkdir /opt/cloudera-manager

tar zxvf cloudera-manager*.tar.gz -C /opt/cloudera-manager

 

2、创建用户cloudera-scm

useradd --system --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm

 

下载cm网址

http://archive.cloudera.com/cm5/cm/5/

 

下载cdh5

http://archive.cloudera.com/cdh5/parcels/

 

3、配置CM Agent

修改文件

vi /opt/cloudera-manager/cm-5.4.7/etc/cloudera-scm-agent/config.ini

 

修改节点名称server_host

 

4、配置cm server数据库

mkdir /usr/share/java

上传mysql的jar包,名称必须修改成mysql-connector-java.jar

grant all on *.* to 'temp'@'%' identified by 'temp' with grant option;

cd /opt/cloudera-manager/cm-5.4.7/share/cmf/schema/

./scm_prepare_database.sh mysql temp -h node1 -utemp -ptemp --scm-host node1 scm scm scm

 

提示All done, your SCM database is configured correctly!

则表示成功

 

5、创建Parcel目录

server节点

mkdir -p /opt/cloudera/parcel-repo

chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo

agent节点

mkdir -p /opt/cloudera/parcels

chown cloudera-scm:cloudera-scm /opt/cloudera/parcels

 

6、制作CDH本地源

manifest.json

CDH-5.9.0-1.cdh5.9.0.p0.23-el5.parcel.sha1

CDH-5.9.0-1.cdh5.9.0.p0.23-el5.parcel

文件移动到/opt/cloudera/parcel-repo目录下

 

7、启动CM Server、Agent

cd /opt/cloudera-manager/cm-5.4.7/etc/init.d/

./cloudera-scm-server start

./cloudera-scm-agent start

 

查看日志

tail -f /opt/cloudera-manager/cm-5.4.7/log/cloudera-scm-server/cloudera-scm-server.log

 

登录

http://ip:7180

echo 10 > /proc/sys/vm/swappiness

echo never > /sys/kernel/mm/transparent_hugepage/defrag

 

创建hive数据库

create database hive DEFAULT CHARACTER SET utf8;

grant all on hive.* TO 'hive'@'%' IDENTIFIED BY 'hive';

 

创建oozie数据库

create database oozie DEFAULT CHARACTER SET utf8;

grant all on oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie';

 

创建sqoop数据库

create database sqoop DEFAULT CHARACTER SET utf8;

grant all on sqoop.* TO 'sqoop'@'%' IDENTIFIED BY 'sqoop';

以上内容参考北京尚学堂视频课程

 

 

 

展开阅读全文
打赏
1
16 收藏
分享

作者的其它热门文章

加载中
这也叫笔记。。。。。。
2017/01/19 09:14
回复
举报
更多评论
打赏
1 评论
16 收藏
1
分享
返回顶部
顶部