storm&kafka&es 基本命令

storm:

打包:   

maven clean install -P dev/pre/pro

提交拓扑:

./storm jar bi-daemon-itemmodel-0.0.1-SNAPSHOT-jar-with-dependencies.jar cn.com.gome.itemmodel.ItemModelTopology item-model

kill拓扑:

./storm kill item-model-local

kafka:

消费者(全)

./kafka-console-consumer.sh --zookeeper localhost:2181 --topic item-model-topic --from-beginning

生产者

./kafka-console-producer.sh --broker-list localhost:9092 --topic item-model-topic

集群启动:

./kafka-server-start.sh config/server.properties &

修改topic的partition

./kafka-topics.sh --zookeeper localhost:2181 --alter --partitions 1 --topic item-model-topic

创建topic

./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic item-model-topic

删除topic

./kafka-topics.sh  --delete --zookeeper localhost:2181 --topic item-model-topic

查看topic

看列表:./kafka-topics.sh --list --zookeeper localhost:2181

看属性:./kafka-topics.sh --describe --zookeeper localhost:2181 --topic item-model-topic

查看comsumer

看列表: ./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list

看属性: ./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group testConsumer

ES

mapping:

curl -XGET http://10.69.201.47:9200/item-index/_mapping/item-type

分组:

curl -XGET http://ec2-54-251-189-240.ap-southeast-1.compute.amazonaws.com:9200/item-index/item-type/_search?pretty -d '{"query": {"bool": {"must": [{"match_all": {}}],"must_not": [],"should": []}},"from": 0,"size": 10,"sort": [],"aggs": {"category": {"terms": {"field": "categoryId"}}}}'

创建别名:

curl -XPOST 'http://10.69.201.47:9200/_aliases' -d '

{

"actions": [

{"add": {"index": "item-index", "alias": "item-index-alias"}}

]

}'

移动别名:

curl -XPOST 'http://54.254.147.171:9200/_aliases' -d '

{

"actions": [

{"remove": {"index": "item-index", "alias": "item-index-alias"}},

{"add": {"index":"item-index-v1", "alias": "item-index-alias"}}

]

}'

查看别名:

curl -XGET 'http://10.69.201.47:9200/_alias/*'

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容