Storm/kafka/flume运维命令

1. 启动zookeeper集群

#h0和h1上分别执行
zkServer.sh start
#查看zookeeper状态
zkServer.sh status

2. 启动storm

#h0上执行
nohup storm nimbus &
nohup storm ui &
#h1和h2上执行
nohup storm supervisor &

3. 启动hdfs

#h0上执行
start-dfs.sh

4. 启动kafka

#h0上启动kafka服务,启动两个broker
nohup kafka-server-start.sh $KAFKA_HOME/config/server1.properties &
nohup kafka-server-start.sh $KAFKA_HOME/config/server1.properties &
#查询所有topic
kafka-topics.sh --list --zookeeper h0:2181
#创建一个topic
kafka-topics.sh --create --zookeeper h0:2181 --replication-factor 1 --partitions 1 --topic test
#启动消息生产者
kafka-console-producer.sh --broker-list h0:9092 --topic test
#启动消息消费者
kafka-console-consumer.sh --zookeeper h0:2181 --topic test --from-beginning

删除kafka中的topic,这里介绍一下在zookeeper中如何删除。执行zkCli.sh,命令就看图吧:
这里写图片描述

5. 启动flume

1. 启动flume命令
flume-ng agent -c $FLUME_CONF_DIR -f $FLUME_CONF_DIR/hdfs.conf --name a1 -Dflume.root.logger=INFO,console
2. flume简单配置,其他配置可以到用户手册中查找
# example.conf: A single-node Flume configuration
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值