一 环境准备
1 安装 ubuntu 14.04系统。
(这里不做描述)
2 配置网络环境
保障能够正常访问外网。(这里不做描述)
3 准备物理机器
不少于三台,机器要求:Cloudera Server 端,内存不少于8G,Cloudera Clent 端,内存不少于4G。
4 配置设置系统root用户密码。
libf@CDH-02:~$ sudo passwd
[sudo] password for libf:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
libf@CDH-02:~$ su
Password:
root@CDH-02:/home/libf#
注:后续的软件安装过程以及系统配置都使用root用户进行操作。
5 配置机器的主机名(hostname)和主机名映射(hosts)
root@CDH-02:~# vi /etc/hostname
博主机器配置如下:
CDH-02
root@CDH-02:~# vi /etc/hosts
博主机器配置如下:
127.0.0.1 localhost
10.0.3.158 CDH-01
10.0.3.156 CDH-02
10.0.3.186 CDH-03
10.0.3.164 CDH-04
10.0.3.179 CDH-05
10.0.3.196 CDH-06
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
注:博主有6台物理机器,其中CHD-01为Cloudera-Manages 服务端,其余都为 Cloudera-Agent 端。
二 依赖软件安装
添加安装依赖软件
1 vim安装
默认Ubuntu 14.04 是没有安装vim的,后续需要修改很多配置文件,博主习惯用vim工具,根据个人喜好安装文本编辑工具。
root@CDH-02:~# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
vim is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 464 not upgraded.
root@CDH-02:~#
注:博主机器已经安装过vim,如果再次安装则提示你已经安装不需要再次安装了。
2 ssh安装
这个工具要装(你懂得),2个理由:1,可以远程管理系统。2,Cloudera Manages 集群管理需要用该服务。
root@CDH-02:~# apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 464 not upgraded.
root@CDH-02:~#
ssh 服务配置
打开sshd_config文件, 在 /etc/ssh 目录下。
root@CDH-02:~# vi /etc/ssh/sshd_config
注释掉 #PermitRootLogin without-password 行。
添加 PermitRootLogin yes 行
修改后,如下:
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
注:修改这行的目的是能够使用root用户远程连接到该机器上进行操作,和后续Cloudera Manages配置使用。
3 MySQL安装
注意:Cloudera-Manages-Server 端 需要安装 MySql,Cloudera-Manages-Agent 端 可以不装。
安装指导详见链接:http://blog.csdn.net/blackkey2008/article/details/50763681
三 安装 Cloudera-Manages-server
配置server节点(CDH-01)
1 配置Cloudera 下载源
1. Save the appropriate Cloudera Manager list file (cloudera.list) for your system: (下载源文件)
http://archive.cloudera.com/cm5/debian/squeeze/amd64/cm/cloudera.list
2. Copy the content of that file to the cloudera-manager.list file in the/etc/apt/sources.list.d/ directory. (拷贝到目录 //etc/apt/sources.list.d/ 下)
3. Update your system package index by running: (更新源)
root@CDH-01:~# apt-get update
4. get apt key (获得APT KEY)
root@CDH-01:~# curl -s https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/archive.key| sudo apt-key add -
2 安装JAVA JDK
root@CDH-01:~# apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold -y install oracle-j2sdk1.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
oracle-j2sdk1.7 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 464 not upgraded.
root@CDH-01:~#
3 安装 Cloudera Manager Server 包
apt-get install cloudera-manager-daemons cloudera-manager-server
4 配置cloudera-manager-server数据库
/usr/share/cmf/schema/scm_prepare_database.sh mysql -uroot -p --scm-host localhost scm scm scm_password
四 安装 Cloudera-Manages-agent
配置其余Agent节点(CDH-01/CDH-02/CDH-03/CDH-04/CDH-05/CDH-06)
注:CDH-01 及跑服务端又跑代理端
1 配置Cloudera 下载源
1. Save the appropriate Cloudera Manager list file (cloudera.list) for your system: (下载源文件)
http://archive.cloudera.com/cm5/debian/squeeze/amd64/cm/cloudera.list
2. Copy the content of that file to the cloudera-manager.list file in the/etc/apt/sources.list.d/ directory. (拷贝到目录 //etc/apt/sources.list.d/ 下)
3. Update your system package index by running: (更新源)
root@CDH-01:~# apt-get update
4. get apt key (获得APT KEY)
root@CDH-01:~# curl -s https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/archive.key| sudo apt-key add -
2 安装JAVA JDK
root@CDH-01:~# apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold -y install oracle-j2sdk1.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
oracle-j2sdk1.7 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 464 not upgraded.
root@CDH-01:~#
3 安装 Cloudera Manager Agent包
apt-get install cloudera-manager-daemons cloudera-manager-agent
五 总结以及小技巧
1 Cloudera的源速度比较慢,下载程序包非常缓慢。集群部署每台机器都要下载安装,崩溃!!!!
技巧:通过apt-get命令先安装 Clouder-Manager-server 端,安装完成后,在apt的目录下可以看到如下:
root@CDH-02:/var/cache/apt/archives# pwd
/var/cache/apt/archives
root@CDH-02:/var/cache/apt/archives# ls -l
total 506832
-rw-r--r-- 1 root root 87528 1月 15 02:15 apache2_2.4.7-1ubuntu4.9_amd64.deb
-rw-r--r-- 1 root root 838694 1月 15 02:15 apache2-bin_2.4.7-1ubuntu4.9_amd64.deb
-rw-r--r-- 1 root root 159820 1月 15 02:15 apache2-data_2.4.7-1ubuntu4.9_all.deb
-rw-r--r-- 1 root root 5710492 2月 17 06:42 cloudera-manager-agent_5.5.3-1.cm553.p0.1~trusty-cm5_amd64.deb
-rw-r--r-- 1 root root 507648498 2月 17 06:42 cloudera-manager-daemons_5.5.3-1.cm553.p0.1~trusty-cm5_all.deb
-rw-r--r-- 1 root root 596524 1月 26 22:09 libmysqlclient18_5.5.47-0ubuntu0.14.04.1_amd64.deb
-rw-r--r-- 1 root root 80564 2月 12 01:59 libpq5_9.3.11-0ubuntu0.14.04_amd64.deb
-rw-r--r-- 1 root root 826598 12月 7 20:45 libssl1.0.0_1.0.1f-1ubuntu2.16_amd64.deb
-rw-r--r-- 1 root root 1071744 12月 7 20:45 libssl-dev_1.0.1f-1ubuntu2.16_amd64.deb
-rw-r--r-- 1 root root 966428 12月 7 20:45 libssl-doc_1.0.1f-1ubuntu2.16_all.deb
-rw-r----- 1 root root 0 2月 19 2015 lock
-rw-r--r-- 1 root root 13484 1月 26 22:09 mysql-common_5.5.47-0ubuntu0.14.04.1_all.deb
-rw-r--r-- 1 root root 562066 1月 27 09:54 openssh-client_1%3a6.6p1-2ubuntu2.6_amd64.deb
-rw-r--r-- 1 root root 321004 1月 27 09:54 openssh-server_1%3a6.6p1-2ubuntu2.6_amd64.deb
-rw-r--r-- 1 root root 34188 1月 27 09:54 openssh-sftp-server_1%3a6.6p1-2ubuntu2.6_amd64.deb
drwxr-xr-x 2 root root 4096 2月 22 17:57 partial
-rw-r--r-- 1 root root 37056 10月 1 01:04 rpcbind_0.2.1-2ubuntu2.2_amd64.deb
root@CDH-02:/var/cache/apt/archives#
发现没有,所有使用apt-get安装过的程序包都在这里。
是的,apt-get在线安装的包,会缓存在这个(/var/cache/apt/archives)下。
我们只需要将这里需要的cloudera包,拷贝到需要安装cloudera的机器上的相应目录(/var/cache/apt/archives)下就可以,
再使用apt-get命令安装,程序发现包已经存在,则不会再去下载程序包,就直接安装了,省去了下载包的漫长过程。
其中
oracle-j2sdk1.7_1.7.0+update67-1_amd64.deb
cloudera-manager-daemons_5.5.3-1.cm553.p0.1~trusty-cm5_all.deb
cloudera-manager-agent_5.5.3-1.cm553.p0.1~trusty-cm5_amd64.deb
这几个包下载非常慢,并且比较大,可以只拷贝这几个包过去。
2 CDH 下载缓慢并且巨大(1.5G)
技巧:
在线现在要看网速了,博主使用公司网络下载十分缓慢,基本上要下载一天。
您可以选择在线下载,前提是网络环境好。
您也可以选择离线下载,使用下载工具下载CDH的离线包,放到指定目录:
下载地址:
root@CDH-01:/opt/cloudera/parcel-repo# pwd
/opt/cloudera/parcel-repo
root@CDH-01:/opt/cloudera/parcel-repo# ls -l
total 1492724
-rw-r--r-- 1 root root 1528541128 2月 26 08:54 CDH-5.5.2-1.cdh5.5.2.p0.4-trusty.parcel
-rw-r--r-- 1 root root 41 2月 26 08:52 CDH-5.5.2-1.cdh5.5.2.p0.4-trusty.parcel.sha
root@CDH-01:/opt/cloudera/parcel-repo#