资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

如何部署集群测试环境?

一、需求

网站的建设创新互联公司专注网站定制,经验丰富,不做模板,主营网站定制开发.小程序定制开发,H5页面制作!给你焕然一新的设计体验!已为成都小搅拌车等企业提供专业服务。

  在本地上部署了两套环境,一套用于开发环境,另一套用于测试环境。在这里,我抽其测试这套环境,做了个总结,具体安装步聚,在这里不作详细解释,如果需要,我可以提供一份我总结文档作参考。每套环境上用到了11台机器,注意了,在这里用到全部是cdm5.5.0版本

http://archive.cloudera.com/cdh6/cdh/5/

二、集群规划

1、测试集群

如何部署集群测试环境?

2、实时环境

如何部署集群测试环境?

三、依赖关系说明

 后台系统包括以下组件:zookeeper、hdfs、yarn、jobhistoryserver、hive metastore、hiveserver2、hbase、kafka 和 jstorm,以上个组件存在先后依赖关系,如下图所示

如何部署集群测试环境?

在上图中,上层的组件依赖下层的组件,所以启动的时候要由下往上启动,停止的时候要由上往下停止。

 

四、后台运维

1、测试环境部署及

zookeeper:testhadoop240、testhadoop241、testhadoop242

hadoop:testhadoop231、testhadoop232、testhadoop233、testhadoop234、testhadoop235、testhadoop236

hive:testhadoop233

hbase:testhadoop231、testhadoop232、testhadoop233

kafka:testhadoop240、testhadoop241、testhadoop242

jstorm:testhadoop240、testhadoop241、testhadoop242

MySQL,nginx:testhadoop245

2,启停命令说明

2.1 zookeeper

部署机器:testhadoop240、testhadoop241、testhadoop242

部署位置:/usr/local/zookeeper

启动命令:/usr/local/zookeeper/bin/zkServer.sh start (分别在每台机器执行)

停止命令:/usr/local/zookeeper/bin/zkServer.shstop (分别在每台机器执行)

启动验证:/usr/local/zookeeper/bin/zkCli.sh-server testhadoop240:2181


2.2 hdfs

部署机器:testhadoop231、testhadoop232、testhadoop233、testhadoop234、testhadoop235、testhadoop236

部署位置:/usr/local/hadoop

启动命令:/usr/local/hadoop/sbin/start-dfs.sh (在 testhadoop231 或 testhadoop232上执行)

停止命令:/usr/local/hadoop/sbin/stop-dfs.sh (在 testhadoop231或 testhadoop232 上执行)

启动验证:访问 http://test.hdfs1.xxx.com 或 http://test.hdfs2.xxx.com


2.3 yarn

部署机器:跟 hdfs 相同

部署位置:跟hdfs 相同

启动命令:/usr/local/hadoop/sbin/start-yarn.sh (在 testhadoop231 或 testhadoop232上执行)

停止命令:/usr/local/hadoop/sbin/stop-yarn.sh (在 testhadoop231或 testhadoop232 上执行)

启动验证:访问 http://test.rm1.xxx.com 或 http://test.rm2.xxx.com

2.4 jobhistoryserver

部署机器:testhadoop231

部署位置:跟hdfs 相同

启动命令:/usr/local/hadoop/sbin/mr-jobhistory-daemon.sh start historyserver

停止命令:/usr/local/hadoop/sbin/mr-jobhistory-daemon.shstop historyserver

启动验证:访问 http://test.mapreduce.xxx.com

2.5 hive metastore

部署机器:testhadoop233

部署位置:/usr/local/hive

启动命令:/usr/local/hive/bin/start-metastore.sh

停止命令:ps -ef |grep MetaStore  找到进程号,把它kill掉

启动验证:待补充


2.6 hiveserver2

部署机器:testhadoop233

部署位置:/usr/local/hive

启动命令:/usr/local/hive/bin/start-hiveserver2.sh

停止命令:ps -ef |grep HiveServer2 找到进程号,把它kill掉

启动验证:待补充

 

2.7 hbase

部署机器:testhadoop231、testhadoop232、testhadoop233

部署位置:/usr/local/hbase

启动命令:/usr/local/hbase/bin/start-hbase.sh (testhadoop231)

停止命令:/usr/local/hbase/bin/stop-hbase.sh (testhadoop231)

启动验证:http://test.hbase.xxx.com

 

2.8 kafka 

部署机器:testhadoop240、testhadoop241、testhadoop242

部署位置:/usr/local/kafka_2.9.2-0.8.2.2

启动命令:/usr/local/kafka_2.9.2-0.8.2.2/starKafkaServer.sh

停止命令:ps -ef |grep kafka 找到进程号,把它kill掉

启动验证:

使用hadoop2用户登录dchadoop213、dchadoop214、dchadoop215中的任意一台机器,执行以下命令:

a.创建topic

/usr/local/kafka_2.9.2-0.8.2.2/bin/kafka-topics.sh--zookeeper devhadoop237:2181,devhadoop238:2181,devhadoop239:2181/kafka--create  --topic mytest --replication-factor 1 --partitions 3

b.查看topic列表

/usr/local/kafka_2.9.2-0.8.2.2/bin/
kafka-topics.sh--zookeeper devhadoop237:2181,devhadoop238:2181,devhadoop239:2181/kafka --list

c.创建生产者

/usr/local/kafka_2.9.2-0.8.2.2/bin/
kafka-console-producer.sh--broker-list devhadoop237:9092,devhadoop238:9092,devhadoop239:9092 --topicmytest

d.创建消费者

/usr/local/kafka_2.9.2-0.8.2.2/bin/
kafka-console-consumer.sh--zookeeper devhadoop237:2181,devhadoop238:2181,devhadoop239:2181/kafka --topicmytest --from-beginning

其中 mytest 是用户指定的topic,实际开发时需要根据业务自定义topic

 

2.9 jstorm

部署机器:testhadoop240、testhadoop241、testhadoop242

部署位置:/usr/local/jstorm-2.1.0/

启动命令:

启动nimbus:nohupjstorm nimbus & (在 testhadoop240上执行)

启动 supervisor:nohupjstorm supervisor &(在 testhadoop240~242上执行)

启动 web-ui:/usr/local/tomcat/bin/startup.sh

 

停止命令:

停止nimbus:ps -ef |grep nimbus 找到进程号,把它kill掉 (在 testhadoop240上执行)

停止 supervisor:ps -ef|grep supervisor 找到进程号,把它kill掉(在 testhadoop240~242上执行)

停止 web-ui:/usr/local/tomcat/bin/shutdown.sh


网站栏目:如何部署集群测试环境?
网页URL:http://cdkjz.cn/article/gepsei.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220