温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何部署集群测试环境?

发布时间:2020-05-29 16:03:36 来源:亿速云 阅读:439 作者:鸽子 栏目:大数据

一、需求

  在本地上部署了两套环境,一套用于开发环境,另一套用于测试环境。在这里,我抽其测试这套环境,做了个总结,具体安装步聚,在这里不作详细解释,如果需要,我可以提供一份我总结文档作参考。每套环境上用到了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

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI