目录
1规划服务器 2
2安装和配置Mysql数据库 4
3离线安装Cloudera Manager5和CDH5 7
3.1创建本地yum软件源 7
3.2使用本地类库安装CM 11
3.3设置cloudera manager使用的mysql数据库 11
3.4 使用本地类库安装CDH5 13
4HDFS启用HA高可用性(基于Quorum-based Storage) 17
5.安装使用GPL Extras 23
5.1 GPL Extras安装 23
5.2 配置MapReduce(如果部署了) 24
5.3 配置HDFS 25
5.4 配置Yarn 26
5.3部署配置和重启服务 26
6.安装Storm 27
6.1安装依赖 27
6.2安装资源准备 27
6.3 安装 28
6.4 配置 30
6.5 运行 30
7.附录. 31
7.1CDH安装部署问题记录 32
1规划服务器
1.1系统版本
Red Hat Enterprise Linux 6.2 and 6.4, and CentOS 6.2 and 6.4, 64-bit
内存64GB以上
1.2本地浏览器
在Cloudera Manager Admin 控制台,你能配置、管理、监控CDH,目前支持的浏览器为:
Firefox 11 or later
Google Chrome
Internet Explorer 9
Safari 5 or later
1.3硬盘要求
/var 最低20GB(40G)
/usr 最低15G
/opt 最低15G(20G)
1.4需要配置/etc/hosts
1、请根据实际需求为每一台主机配置hosts文件,例如:
127.0.0.1 localhost.localdomain localhost
192.168.1.1host-01.domain host-01
192.168.1.2 host-02.domain host-02
192.168.1.3 host-03.domain host-03
//Chenzr
192.168.248.128 centos-1
192.168.248.129 centos-2
192.168.248.130 centos-3
192.168.248.128 centos01.domain centos-1
192.168.248.129 centos02.domain centos-2
192.168.248.130 centos03.domain centos-3
2、为每一台主机修改主机名,例如将主机名修改为host-01.domain可执行如下命令:
hostname host-01.domain
echo ‘NETWORKING=yes’ >/etc/sysconfig/network
echo ‘HOSTNAME=host-01.domain’>>/etc/sysconfig/network
1.5需要将规划cluster中所有服务器的密码统一
1.6 CentOS release 6.3系统需要配置(禁用透明大页面):
执行命令:
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
执行以下命令,将命令加入:/etc/rc.local
echo ‘echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag’ >>/etc/rc.local
echo ‘service ip6tables stop’ >> /etc/rc.local
1.7关闭selinux服务:
关闭selinux:setenforce 0
修改/etc/selinux/config:SELINUX=disabled;
执行命令:
setenforce 0
sed -i ‘s/(SELINUX=)enforcing/\1disabled/g’ /etc/selinux/config
1.8需要同步各服务器时钟
配置crontab 同步时钟:0 3 * * * /usr/sbin/ntpdate 202.141.176.110;/sbin/hwclock –w
执行命令:
echo “0 3 * * * /usr/sbin/ntpdate 202.141.176.110;/sbin/hwclock –w”>>/var/spool/cron/root
service crond restart
即时时间同步命令(先关闭ntpd):ntpdate 202.141.176.110
其中202.141.176.110为中科大时间服务器,也可采用其他授时服务器,请确保该服务器可达。
1.9启用ntp服务(cloudera manager 5.0及以上)
service ntpd start
2.0禁用虚拟内存页交换
echo 0 > /proc/sys/vm/swappiness
2.1 调整文件描述符
vi /etc/security/limits.conf 添加一行: * - nofile 65535
2.2设置防火墙
配置防火墙规则,使集群内所有网段都能够互通
systemctl stop firewalld.service
systemctl disable firewalld.service
2.3 修改tcp_keepalive默认值
vi /etc/sysctl.conf
添加net.ipv4.tcp_keepalive_time = 180
sysctl -p
2安装和配置Mysql数据库
2.1官方安装文档
安装和配置Mysql数据库的步骤来自于cloudera的官方文档,链接如下:
http://www.cloudera.com/content/cloudera-content/cloudera-docs/CM4Ent/latest/Cloudera-Manager-Installation-Guide/cmig_install_mysql.html
下载官方Yum源:http://dev.mysql.com/downloads/repo/
安装官方Yum源:sudoyum localinstall mysql-community-release-el6-*.noarch.rpm
安装mysql:sudo yum install mysql-server
2.2更新/etc/my.cnf或/etc/mysql/my.cnf
因为更新配置文件可能会依照特定需求修改mysql数据文件及日志文件等存储目录,为确保mysql用户对新目录拥有相应的权限,可在更新配置文件前将原mysql拥有目录复制至新目录:
[mysqld]
datadir=/home/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
skip-name-resolve
skip-grant-tables
*# Disabling symbolic-links is recommended to prevent assorted security risks
*#symbolic-links=0
transaction-isolation=READ-COMMITTED
*# Disabling symbolic-links is recommended to prevent assorted security risks;
*# to do so, uncomment this line:
*# symbolic-links=0
(*记得去掉)
key_buffer = 16M
key_buffer_size = 32M
max_allowed_packet = 16M
thread_stack = 256K
thread_cache_size = 64
query_cache_limit = 8M
query_cache_size = 64M
query_cache_type = 1
*# Important: see Configuring the Databases and Setting max_connections
max_connections = 750
*# log-bin should be on a disk with enough free space
*#log-bin=/x/home/mysql/logs/binary/mysql_binary_log
*# For MySQL version 5.1.8 or later. Comment out binlog_format for older versions.
*#binlog_format = mixed
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
*# InnoDB settings
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 64M
innodb_buffer_pool_size = 4G
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_log_file_size = 512M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
2.3安装MySQL JDBC Connector
sudo yum install mysql-connector-java
2.4启动Mysql
sudo service mysqld start
2.5设置Mysql的root密码,初始密码为空(非必须)rootcentos
$ sudo /usr/bin/mysql_secure_installation
[…]
Enter current password for root (enter for none):
OK, successfully used password, moving on…
[…]
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
[…]
Disallow root login remotely? [Y/n] N
[…]
Remove test database and access to it [Y/n] Y
[…]
Reload privilege tables now? [Y/n] Y
All done!
2.6设置Mysql为开机自动启动
sudo/sbin/chkconfigmysqldon
sudo /sbin/chkconfig –list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
2.7为Cloudera Manager创建MySQL Databases
(1)用root登陆Mysql:$ mysql -u root –p
(2)脚本
create database amon DEFAULT CHARACTER SET utf8;
grant all on amon.* TO ‘amon’@’%’ IDENTIFIED BY ‘amon_password’;
create database smon DEFAULT CHARACTER SET utf8;
grant all on smon.* TO ‘smon’@’%’ IDENTIFIED BY ‘smon_password’;
create database rman DEFAULT CHARACTER SET utf8;
grant all on rman.* TO ‘rman ‘@’%’ IDENTIFIED BY ‘rman_password’;
create database hmon DEFAULT CHARACTER SET utf8;
grant all on hmon.* TO ‘hmon’@’%’ IDENTIFIED BY ‘hmon_password’;
create database hive DEFAULT CHARACTER SET utf8;
grant all on hive.* TO ‘hive’@’%’ IDENTIFIED BY ‘hive_password’;
create database nav DEFAULT CHARACTER SET utf8;
grant all on nav.* TO ‘nav’@’%’ IDENTIFIED BY ‘nav_password’;
(3)执行实例
Create a database for the Activity Monitor. The database name, user name, and password can be anything you want. For example:
mysql> create database amon DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql>grant all on amon.* TO ‘amon’@’%’ IDENTIFIED BY ‘amon_password’;
Query OK, 0 rows affected (0.00 sec)
(3)Create a database for the Service Monitor. The database name, user name, and password can be anything you want. For example:
mysql> create database smon DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on smon.* TO ‘smon’@’%’ IDENTIFIED BY ‘smon_password’;
Query OK, 0 rows affected (0.00 sec)
(4)Create a database for the Report Manager. The database name, user name, and password can be anything you want. For example:
mysql> create database rman DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on rman.* TO ‘rman ‘@’%’ IDENTIFIED BY ‘rman_password’;
Query OK, 0 rows affected (0.00 sec)
(5)Create a database for the Host Monitor. The database name, user name, and password can be anything you want. For example:
mysql> create database hmon DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on hmon.* TO ‘hmon’@’%’ IDENTIFIED BY ‘hmon_password’;
Query OK, 0 rows affected (0.00 sec)
(6)Create a database for the Hive metastore. The database name, user name, and password can be anything you want. For example:
mysql> create database hive DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on hive.* TO ‘hive’@’%’ IDENTIFIED BY ‘hive_password’;
Query OK, 0 rows affected (0.00 sec)
(7)Create a database for Cloudera Navigator. The database name, user name, and password can be anything you want. For example:
mysql> create database nav DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql>grant all on nav.* TO ‘nav’@’%’ IDENTIFIED BY ‘nav_password’;
Query OK, 0 rows affected (0.00 sec)
2.8为Mysql设置备份
使用mysqldump,命令格式如下:
mysqldump-h-u-p>/tmp/.sql
For example, to back up database scm_database on the local host as the root user, with the password mypasswd:
mysqldump−pmypasswdscmdatabase>/tmp/scmdatabase−backup.sqlTobackupdatabasescmdatabaseonremotehostmyhost.example.comastherootuser,withthepasswordmypasswd:
mysqldump -hmyhost.example.com -uroot -pcloudera scm_database > /tmp/scm_database-backup.sql
3离线安装Cloudera Manager5和CDH5
3.1创建本地yum软件源
3.1.1下载Cloudera Manager安装文件
Cloudera Manager的可以从如下网址获得:http://archive.cloudera.com/cm5/installer/
这里选择Cloudera Manager 最新版5.0.1.13,可用如下命令下载:
*#wget http://archive.cloudera.com/cm5/installer/5.0.1.13/cloudera-manager-installer.bin
http://archive.cloudera.com/cm5/installer/5.11.1/cloudera-manager-installer.bin
3.1.2 下载相关的CM安装所需要的RPM包
下载网址为:http://archive-primary.cloudera.com/cm5/redhat/6/x86_64/cm/5.0.1/RPMS/
下载全部rpm包:
*# wget -c -r -nd -np -L -A rpmhttp://archive-primary.cloudera.com/cm5/redhat/6/x86_64/cm/5.0.1/RPMS/x86_64/
http://archive-primary.cloudera.com/cm5/redhat/6/x86_64/cm/5.11.1/RPMS/x86_64/
注:由于CM当前的noarch/下没有包,故只下载目录x86_64/下的所有rpm包。
3.1.3创建和配置CM软件源
将下载好的rpm文件拷贝到制定目录,如:/home/cloudera/cm/中
[root@lemon cm]# ls
cloudera-manager-agent-5.0.1-1.cm501.p0.257.el6.x86_64.rpm
cloudera-manager-daemons-5.0.1-1.cm501.p0.257.el6.x86_64.rpm
cloudera-manager-installer.bin
cloudera-manager-server-5.0.1-1.cm501.p0.257.el6.x86_64.rpm
cloudera-manager-server-db-2-5.0.1-1.cm501.p0.257.el6.x86_64.rpm
enterprise-debuginfo-5.0.1-1.cm501.p0.257.el6.x86_64.rpm
jdk-6u31-linux-amd64.rpm
oracle-j2sdk1.7-1.7.0+update45-1.x86_64.rpm
如果创建软件源的主机没有安装createrepo,可以通过shell命令yum install createrepo安装。
当在包含文件的目录下运行如下创建命令:
[root@lemon cm]# createrepo .
程序会在当前目录下创建一个repodata目录,该目录包含一些描述软件源的xml文件。
[root@lemon cm]# createrepo .
Spawning worker 0 with 7 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@lemon cm]# cd repodata/
[root@lemon repodata]# ls
other.xml.gz
other.sqlite.bz2
filelists.sqlite.bz2
primary.xml.gz
filelists.xml.gz
primary.sqlite.bz2
repomd.xml
此命令之后,RPM包就会加入到本地的软件源中。
在客户端要配置好reppo文件,命名为cloudera-manager.repo
Repo 配置如下:
[root@host-127 yum.repos.d]# cat cloudera-manager.repo
[cloudera-manager]
name = Cloudera Manager, Version 5.0.1
baseurl = http://192.168.5.81/cm/
gpgkey = http://192.168.5.81/cm/RPM-GPG-KEY-cloudera
gpgcheck = 1
注意:name不能出现中文字符
3.1.4下载相关的CDH安装所需要的Parcel包
新建parcel源目录
*#mkdir -p /home/cloudera/parcel-repo
进入parcel源目录并下载CentOS6对应的parcel
*#cd /home/cloudera/parcel-repo
*#wget http://archive.cloudera.com/cdh5/parcels/5.0.1/CDH-5.0.1-1.cdh5.0.1.p0.47-el6.parcel
下载同目录下的manifest.json文件
*#wget http://archive.cloudera.com/cdh5/parcels/5.0.1/manifest.json
创建一个sha文件,在manifest.json中找到对应parcel的Hash值,并输入sha文件中:
命令:
*#cat >CDH-5.0.1-1.cdh5.0.1.p0.47-el6.parcel.sha
ec68971d2969a5a31e720a2a79ce7a7c1d38e397
总之,要确保/home/cloudera/parcel-repo下面有三个文件:
CDH-5.0.1-1.cdh5.0.1.p0.47-el6.parcel
CDH-5.0.1-1.cdh5.0.1.p0.47-el6.parcel.sha
manifest.json
3.1.5安装Apache httpd web服务器
如果你已经安装了一个web服务器,可以略过此步,如果未安装可以通过如下shell命令安装
[root@lemon ~]
yuminstallhttpd安装完毕后,启动httpd服务[root@lemon ]
service httpd start
3.1.6发布软件源文件
Linux下面Web服务器的默认是/var/www/html目录
1、 发布CM Yum源
对parcel-repo目录更改文件权限,使用户、同组、其他组都可以读/执行文件,并在目录/var/www/html下创建/home/cloudera/cm的软连接cm。
[root@lemon ~]
chmod−Rugo+rx/home/cloudera/cm[root@lemonhtml]
ln -s /home/cloudera/cm ./cm
浏览器访问http://:80/cm,测试文件首页是否正常显示各文件的索引,如下:
个人心得:如果打开不成功
1,关闭防火墙
2,在/etc/httpd/conf/httpd.conf添加 ServerName localhost
3 iptables -L之后关闭 执行 iptables -F
2、发布CDH Parcel源
对parcel-repo目录更改文件权限,使用户、同组、其他组都可以读/执行文件,并在目录/var/www/html下创建/home/cloudera/parcel-repo的软连接parcel-repo。
[root@lemon ~]
chmod−Rugo+rx/home/cloudera/parcel−repo[root@lemonhtml]
ln -s /home/cloudera/parcel-repo ./parcel-repo
浏览器访问http://:80/parcel-repo,测试文件首页是否正常显示各文件的索引,如下:
3.2使用本地类库安装CM
CM安装必须通过package方式,而CDH可以通过package、parcel方式安装。
安装程序默认从网络下载程序包安装,如果你已经配置好了本地软件源,并将本机(客户端)做了识别配置,只需要在安装的时候添加参数(--skip_repo_package=1),shell命令如下:
$ sudo ./cloudera-manager-installer.bin –skip_repo_package=1
3.3设置cloudera manager使用的mysql数据库
Cloudera manager 默认使用嵌入式数据库postgresql,此步骤可以忽略。如果需要使用mysql作为cloudera manager的数据库,需要预先设定。
步骤一:创建数据库、用户,并授权。例如:
创建数据库:cmf,用户:cmf,密码:123456,为远程服务器 125.88.76.170授权。
create database cmf DEFAULT CHARACTER SET utf8;
grant all on cmf.* TO ‘cmf’@’%’ IDENTIFIED BY ‘123456’;
create user ‘cmf’@’125.88.76.170’ IDENTIFIED BY ‘123456’;
grant all privileges on . to ‘cmf’@’125.88.76.170’ with grant option;
步骤二:预设cloudera manager的数据库
cd /usr/share/cmf/schema/
./scm_prepare_database.sh mysql cmf cmf 123456 -h host-128
(数据库类型:mysql ,数据库:cmf,用户:cmf,密码:123456 ,mysql主机:host-128)
scm_prepare_database.sh使用说明如下:
usage: ./scm_prepare_database.sh [options] (postgresql|mysql|oracle) database username [password]
Prepares a database (currently either MySQL, PostgreSQL or Oracle)
for use by Cloudera Service Configuration Manager (SCM):
o Creates a database (For PostgreSQL and MySQL only)
o Grants access to that database, by:
- (PostgreSQL) Creating a role
- (MySQL) Creating a grant
o Creates the SCM database configuration file.
o Tests if the database connection parameters are valid.
MANDATORY PARAMETERS
database type: either “oracle”, “postgresql” or “mysql”
database: For PostgreSQL and MySQL, name of the SCM database to create.
For Oracle this is the SID of the Oracle database.
username: Username for access to SCM’s database.
OPTIONAL PARAMETERS
password: Password for the SCM user. If not provided, will
prompt for it.
OPTIONS
-h|–host Database host. Default is to connect locally.
-P|–port Database port. If not specified, the database specific
default will be used: namely, 3306 for MySQL,
5432 for PostgreSQL, and 1521 for Oracle.
-u|–user Database username that has privileges for creating
users and grants. The default is ‘root’.
Typical values are ‘root’ for MySQL and
‘postgres’ for PostgreSQL. Not applicable for Oracle.
-p|–password Database Password. Default is no password.
–scm-host SCM server’s hostname. Omit if SCM is colocated with MySQL.
–config-path Path to SCM configuration files.
Default is /etc/cloudera-scm-server.
-f|–force Don’t stop when an error is encountered.
-v|–verbose Print more informational messages.
-?|–help Show this message.
步骤三:重启cloudera-scm-server
service cloudera-scm-server restart
3.4 使用本地类库安装CDH5
通过Cloudera Manager Admin控制台(用户名和密码皆为admin),可以配置、管理、监控集群上的Hadoop,WEB端的URL地址是:http://myhost.example.com:7180。
首次登录页面如下:
搜寻你要部署的主机:
选择Parcels安装方式和parcel源:
配置Cloudera Manager Yum源
所有主机使用相同的密码:
点击Continue进行安装,安装完成后的检测如果没有错误或警告即说明安装成功,可以进入下一步的服务配置。
选择你需要部署的服务:
为服务选择主机:
设置前面创建的Activity Monitor和hive metadata数据库连接:
根据各服务所在主机空间分配情况和实际需求配置存储目录:
点击Continue完成配置,致此即完成了CDH5的安装部署,其间可能会遇到各类问题请参照附录,如果是新问题请搜集至本手册附录。
4HDFS启用HA高可用性(基于Quorum-based Storage)
HDFS高可用性(可选),在非正式环境中可不启用。
Hive启用HA高可用性
设置故障切换方式:
Mapreduce JobTracker启用HA高可用性
CDH集群运行状况验证
1. 验证HDFSHA高可用性是否生效
2. 验证JobTracker HA高可用性是否生效
5.安装使用GPL Extras
在CDH5中HADOOP_LZO正式更名为GPL Extras,且CDH5.0.0对应版本GPLEXTRAS-5.0.0,CDH5.0.1对应GPLEXTRAS-5.0.1。
5.1 GPL Extras安装
配置GPL Extras安装路径:
添加入GPLEXTRAS-5.0.1的parcels的路径,注意为你的CDH找到对应的版本:
http://archive.cloudera.com/gplextras5/parcels/5.0.1/
安装GPL Extras的Parcels:
5.2 配置MapReduce(如果部署了)
5.2.1加入hadoop_lzo的lib目录到MapReduce服务客户端环境安全阀值中
A. 进入MapReduce服务的配置>查看和编辑,搜索”MapReduce Client Safety”.
B. 将以下值加入到MapReduce服务客户端环境安全阀值:
HADOOP_CLASSPATH=
HADOOPCLASSPATH:/opt/cloudera/parcels/GPLEXTRAS/lib/hadoop/lib/∗JAVALIBRARYPATH=
JAVA_LIBRARY_PATH:/opt/cloudera/parcels/GPLEXTRAS/lib/hadoop/lib/native
5.2.1将lzo编码解码方式加入到MapReduce服务的压缩编码解码器中
A. 进入MapReduce服务的配置>查看和编辑,搜索”io.compression”.
B. 将以下值加入到MapReduce服务的压缩编码解码器中:
com.hadoop.compression.lzo.LzoCodec
com.hadoop.compression.lzo.LzopCodec
5.2.3部署客户端配置以及重启服务
A. 以上配置修改,保存修改。将修改的客户端配置部署到集群内节点上
B. 重启MapReduce服务
5.3 配置HDFS
A. 进入HDFS服务的配置>查看和编辑,搜索”io.compression”.
B. 将以下值加入到HDFS服务的压缩编码解码器中:
com.hadoop.compression.lzo.LzoCodec
com.hadoop.compression.lzo.LzopCodec
5.4 配置Yarn
A. 进入Yarn服务的配置>查看和编辑,搜索”hadoop-env.sh “.
B. 将以下值加入到Yarn服务客户端环境安全阀值:
HADOOP_CLASSPATH=
HADOOPCLASSPATH:/opt/cloudera/parcels/GPLEXTRAS/lib/hadoop/lib/∗JAVALIBRARYPATH=
JAVA_LIBRARY_PATH:/opt/cloudera/parcels/GPLEXTRAS/lib/hadoop/lib/native
5.3部署配置和重启服务
A. 重启HDFS服务
B. 重启HBase服务
C. 重启Impala服务
D. 重启Hive服务
E. 重启Yarn服务
完成以上步骤之后,验证lzo压缩是否可用。
另外Hadoop自带有高速压缩库snappy,下附如何为Yarn压缩启用snappy。
Snappy已经被Google开源,作为一个压缩库,它可以利用单颗Intel Corei7处理器内核处理至少每秒250MB~500MB的数据流。
进入Yarn配置编辑,搜索mapreduce.output.fileoutputformat.compress,启用Job输入输出压缩,并将codec的值设置为org.apache.hadoop.io.compress.SnappyCodec,如下:
重启Yarn,验证snappy压缩是否可用。
6.安装Storm
6.1安装依赖
Storm安装依赖下面的环境
jdk,python,zookeeper,zeromq,jzmq,storm
这些环境在本文档的安装过程中,大部分已经安装好了,但是有版本的要求
Python 2.6.6CentOS版本为6.5中,已经安装好了
Storm 0.9.1目前开发使用的版本
Jdk 1.6
6.2安装资源准备
下载storm,下载位置http://storm.incubator.apache.org/downloads.html
特别注意: 版本是0.9.1,并且是zip压缩格式的。
下载zeromq,下载位置http://zeromq.org/
版本选择zeromq-4.0.4
选择posix tarball
下载jzmq,下载位置https://github.com/nathanmarz/jzmq
通过svn或者git下载到本地
6.3 安装
将上述下载的资源上传到需要运行storm的所有机器上
6.3.1 Zeromq安装
解压zeromq
tar zxvf zeromq-4.0.4.tar.gz
进入zeromq-4.0.4目录
cd zeromq-4.0.4
chmod +x autogen.sh
./autogen.sh
./configure
make && make install
默认安装在/usr/local/lib下,通过ls –l /usr/local/lib检查一下,有如下文件就ok
更新库的搜索路径
ldconfig
6.3.2 Jzmq安装
进入jzmq的目录
cd jzmq
生成configure
chmod +x autogen.sh
./autogen.sh
生成makefile
./configure
上述过程中可能遇到JAVA_HOME没有配置的情况
可以在当前用户的bash_profile中添加此环境变量
编译安装
make && make install
默认情况下,安装在/usr/local/lib下
可以通过 ls –l /usr/local/lib查看,有如下文件
更新库的搜索路劲
ldconfig
6.3.3 Storm安装
解压storm安装包
upzip apache-storm-0.9.1-incubating.zip
如果发现unzip没有安装,需要安装包含unzip相关的rpm包
相关的资源可以在http://rpm.pbone.net/上去下载
6.4 配置
进入storm的解压路径
修改conf/storm.yaml
基本的样式
Storm.zookeeper.servers 表示zookeeper服务器的主机名
Ui.port 表示storm ui的监听端口
Nimbus.host 表示nimbus的主机名
Storm.local.dir 表示storm的本地工作目录
Supervisor.slots.ports 表示supervisor中worker的监听端口
配置的格式特别说明:
Storm.zookeeper.servers中的主机名的新行不能以tab开始,以空格开始
并且分隔符’-‘两边需要留一个空格
Supervisor.slots.ports也要遵循上面的规则
配置项与取值之间的”:”后面要留一个空格
6.5 运行
Storm的运行由ui,nimbus,supervisor组成
6.5.1 Nimbus启动
进入storm的安装目录
执行./bin/storm nimbus &
启动后通过jps命令查看 nimbus是否启动成功
6.5.2 supervisor启动
进入storm的安装目录
执行./bin/storm supervisor &
启动后,通过jps命令查看supervisor是否启动成功
6.5.3 ui启动
进入storm的安装目录
执行./bin/storm ui &
启动后,通过lsof –I 8081,查看ui是否成功监听端口8081
也可以通过jps查看是否有core进程
7.附录.
7.1CDH安装部署问题记录
1、 IOException thrown while collecting data from host: No route to host
原因:agent开启了防火墙
解决:service iptables stop (不推荐)
2、 Cloudera recommends setting /proc/sys/vm/swappiness to 0. Current setting is 60. Use the sysctl command to change this setting at runtime and edit /etc/sysctl.conf for this setting to be saved after a reboot. You may continue with installation, but you may run into issues with Cloudera Manager reporting that your hosts are unhealthy because they are swapping. The following hosts are affected:
解决:
*# echo 0 > /proc/sys/vm/swappiness (to apply for now)
*# sysctl -w vm.swappiness=0 (to make this persistent across reboots)
3、 时钟不同步(同步至中科大时钟服务器202.141.176.110)
# echo “0 3 * * /usr/sbin/ntpdate 202.141.176.110;/sbin/hwclock –w”>>/var/spool/cron/root
*# service crond restart
*# ntpdate 202.141.176.110
4、 The host’s NTP service did not respond to a request for the clock offset.
*#service ntpd start
*# ntpdc -c loopinfo (the health will be good if this command executed successfully)
5、 The Cloudera Manager Agent is not able to communicate with this role’s web server.
一种原因是元数据数据库无法连接,请检查数据库配置:
6、 Hive Metastore Server无法启动,修改Hive元数据数据库配置:
7.2 在安装CHD之前,所有主机必须安装一下包:
chkconfig
python (2.6 required for CDH 5)
yum–y install bind-utilspsmisclibxsltzlibsqlitecyrus-sasl-plaincyrus-sasl-gssapifuseportmapfuse-libsredhat-lsb