CDH Hadoop 安装部署
环境:
Hosts | Role |
---|---|
172.16.1.190 | Hbase-Master |
172.16.1.103 | Hbase-slave01 |
172.16.1.104 | Hbase-slave02 |
关闭防火墙和iptables 配置ssh 免密登录
Hbase-Master Hbase-slave01 Hbase-slave02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15[root@hbase-master latest]# getenforce
Disabled
[root@hbase-master latest]# /etc/init.d/iptables status
iptables:未运行防火墙。
[root@localhost ~]# ssh-keygen
[root@localhost ~]# ssh-copy-id 172.16.1.190
[root@localhost ~]# ssh-copy-id 172.16.1.103
[root@localhost ~]# ssh-copy-id 172.16.1.104
#配置hosts文件
[root@localhost ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.190 hbase-master
172.16.1.103 hbase-slave01
172.16.1.104 hbase-slave02修改hostname
Hbase-Master Hbase-slave01 Hbase-slave02
1
2
3
4
5
6
7
8
9[root@hbase-master ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hbase-master
[root@hbase-slave01 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hbase-slave01
[root@hbase-slave02 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hbase-slave02安装jdk1.7
Hbase-Master Hbase-slave01 Hbase-slave02
1
2
3
4
5for i in {hbase-master,hbase-slave01,hbase-slave02};
do
wget http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-7u71-linux-x64.rpm?AuthParam=1510118078_4607a6aba9a9010945114b51f779d90d -O jdk-7u71-linux-x64.rpm && scp jdk-7u71-linux-x64.rpm $i:/opt/jdk-7u71-linux-x64.rpm;
ssh $i "rpm -ivh /opt/jdk-7u71-linux-x64.rpm";
done配置JAVA_HOME环境变量和配置ntpd服务
Hbase-Master Hbase-slave01 Hbase-slave02
1
2
3for i in {hbase-master,hbase-slave01,hbase-slave02};do ssh $i 'echo "JAVA_HOME=/usr/java/latest">/etc/environment';done
for i in {hbase-master,hbase-slave01,hbase-slave02};do ssh $i 'cat /etc/environment';done
for i in {hbase-master,hbase-slave01,hbase-slave02};do ssh $i 'yum install ntpd -y && /etc/init.d/ntpd restart && chkconfig ntpd on;chkconfig ntpd --list;';done
配置ntpd
1 | [root@hbase-master latest]# cat /etc/ntp.conf |grep -v -E "^#|^$" |
查看ntpd同步状态:
1 | [root@hbase-master latest]# ntpstat |
5.mysql安装配置
Hbase-Master
安装mysql
1 | [root@hbase-master latest]# yum install mysql-server mysql |
启动mysql
1 | [root@hbase-master latest]# /etc/init.d/mysqld restart |
设置mysql root密码并验证:
1 | [root@hbase-master latest]# mysqladmin -uroot password "root" |
创建hive/amon数据库,并授权root用户在主节点拥有所有权限
1 | mysql> create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci; |
6.安装Cloudera Manager Server 和Agent
hbase-master
1 | 解压cloudera-manager到/opt/ |
建立cloudera-manager与mysql之间的连接
1 |
|
修改agent配置文件中的server_host为hbase-master并拷贝到slave两个节点
1 | [root@hbase-master opt]# vim /opt/cm-5.1.3/etc/cloudera-scm-agent/config.ini |
在所有节点创建cloudera-scm用户
1 | [root@hbase-master opt]# useradd --system --home=/opt/cm-5.3.2/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm |
准备parcels,用于离线安装CDH5
(记得CDH-5.13.0-1.cdh5.13.0.p0.29-el6.parcel.sha1 改名为CDH-5.13.0-1.cdh5.13.0.p0.29-el6.parcel.sha,否则将重新下载CDH-5.13.0-1.cdh5.13.0.p0.29-el6.parcel)
1 | mv CDH-5.13.0-1.cdh5.13.0.p0.29-el6.parcel.sha1 CDH-5.13.0-1.cdh5.13.0.p0.29-el6.parcel.sha && mv CDH-5.13.0-1.cdh5.13.0.p0.29-el6.parcel* manifest.json cloudera/parcel-repo/ |
- 启动cloudera-scm-server和cloudera-scm-agent
1 | [root@hbase-master opt]# ./cm-5.13.0/etc/init.d/cloudera-scm-server start |
- 进行WEB安装配置
访问172.16.1.190:7180 默认用户名密码都是admin,同意条款,点击下一步
选择版本,免费版
##### 选择要集群的主机选择本地的parcel包安装,如果parcel包不存在,那将会联网下载,非常耗时,本地包安装大概10分钟,分配激活后选择下一步
检查主机正确性,主要检查主机之间各部件的兼容还有系统优化情况,根据提示优化系统
1
2
3
4echo 10 > /proc/sys/vm/swappiness
echo never >/sys/kernel/mm/transparent_hugepage/defrag
echo never >/sys/kernel/mm/transparent_hugepage/enabled
echo -e "echo 10 > /proc/sys/vm/swappiness \necho never >/sys/kernel/mm/transparent_hugepage/defrag \ncho never >/sys/kernel/mm/transparent_hugepage/enabled" >>/etc/rc.local
重新运行主机检查
##### 点击完成 进入集群设置,选择自定义服务,我们选择hbase hdfs zookeeper YARN 点击继续
角色分配,根据实际业务需求选择角色分配,选择后点击继续
连接数据库mysql
设置目录结构,无特殊需求,保持默认即可,点击下一步集群就开始初始化了
初始化完成 点击继续,最后点击完成完成集群安装
- 本文作者: ChuLinx
- 本文链接: http://yoursite.com/2019/01/22/CDH Hadoop部署安装/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!