一、系统环境:
- 物理机:一台8G 的mac
- 虚拟机:安装linux系统:CentOS release 6.5 (对于集群安装,这个才是最终的环境系统)
- cpu:2core
- 内存:6g(对,就是这么多,因为cdh真的很吃内存,这也是装单节点的原因,如果是源生的hadoop,3个节点没压力)
二、安装前提
此文只讨论离线方式安装cm5和cdh5,有以下假定前提:
- 1、jdk环境配置已经配置好
- 2、ssh免密已经配置好(虽然是单节点,还是要配置免密登录,即对本节点的免密登录)
参考:https://blog.youkuaiyun.com/kyle0349/article/details/82532103 - 3、mysql已经安装好,并已经启动
参考:https://blog.youkuaiyun.com/kyle0349/article/details/82493822 - 4、配置好固定ip
参考:https://blog.youkuaiyun.com/kyle0349/article/details/82469939
注意:在上面前提都配置好的情况下,
保存当前虚拟机快照!!!
保存当前虚拟机快照!!!
保存当前虚拟机快照!!!
因为很可能需要多次重新安装…
三、安装环境配置
1、修改节点hostname(这个在安装centos时可以设置,也可以用下面方式更改)
[root@cdh01 ~]# vim /etc/sysconfig/network
HOSTNAME=cdh01
2、检查相关依赖并安装
[root@cdh01 ~]# yum -y install ntp python-lxml httpd mod_ssl cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi
3、启动各种相关服务并加到开机启动服务中
- 3.1、ntpd服务
[root@cdh01 ~]# service ntpd start
[root@cdh01 ~]# chkconfig ntpd on
- 3.2、httpd服务
[root@cdh01 ~]# service httpd start
[root@cdh01 ~]# chkconfig httpd on
- 3.3、启动httpd报警,解决报警【Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using 192.168.171.101 for ServerName】
[root@cdh01 ~]# vim /etc/httpd/conf/httpd.conf
#注释 ServerName www.example.com:80
#添加 ServerName localhost:80
[root@cdh01 ~]# service httpd restart
4、关闭防火墙,并设置开机默认关闭防火墙
[root@cdh01 ~]# service iptables stop
[root@cdh01 ~]# chkconfig iptables off
5、配置ip映射
[root@cdh01 ~]# vim /etc/hosts
[root@cdh01 ~]# 172.16.131.101 cdh01
6、在mysql中添加以下库,并授予远程登录权限
- 6.1、创建这些库的原因是是:cm管理的cdh版hadoop,各个组件是由【各自组件名为用户名】的【用户】管理的。没有这些库,在安装chd的时候无法通过数据库的验证。
eg.
hive,是由hive这个用户管理的,hive相关元数据会写到mysql中对于的hive库中
hue,是由hue这个用户管理的,hue相关的元数据会写到mysql对应的hue库中。 - 6.2、创建语句如下:
create database cmf DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
insert into mysql.user(Host,User,Password,ssl_copher,x509_issuer,x509_subject) values("%","cmf",password("cmf"),"1","1","1");
grant all privileges on cmf.* to cmf@'%' identified by 'cmf';
grant all privileges on cmf.* to cmf@'cdh01' identified by 'cmf';
create database metastore DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
insert into mysql.user(Host,User,Password,ssl_copher,x509_issuer,x509_subject) values("%","metastore",password("metastore"),"1","1","1");
grant all privileges on metastore.* to metastore@'%' identified by 'metastore'<