Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About 2 kafka server #5

Open
xiaoliang-samsung opened this issue Jul 15, 2013 · 1 comment
Open

About 2 kafka server #5

xiaoliang-samsung opened this issue Jul 15, 2013 · 1 comment

Comments

@xiaoliang-samsung
Copy link

I hava 1 zookeeper and 2 kafka servers
each of kafka has 5 partition,So I need to create 10 rivers.

Commands for one kafka

curl -XPUT 'localhost:9200/_river/my_kafka_river_0/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.35",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "0",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_1/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.35",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "1",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_2/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.35",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "2",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_3/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.35",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "3",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_4/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.35",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "4",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'

Commands for another kafka

curl -XPUT 'localhost:9200/_river/my_kafka_river_5/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.121",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "0",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_6/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.121",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "1",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_7/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.121",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "2",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_8/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.121",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "3",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'
curl -XPUT 'localhost:9200/_river/my_kafka_river_9/_meta' -d '{
"type" : "kafka",
"kafka" : {
"broker_host" : "211.43.180.121",
"message_handler_factory_class" : "org.elasticsearch.river.kafka.JsonMessageHandlerFactory",
"zookeeper" : "211.43.180.171",
"topic" : "my_topic",
"partition" : "4",
"broker_port" : 9092
},
"index" : {
"bulk_size_bytes" : 10000000,
"bulk_timeout" : "1000ms"
},
"statsd":{
"prefix": "es-kafka-river",
"host": "statsd.samsungdns.com",
"port": "8125"
}

}'

I just change the "broker_host" ,partition in each of kafka is 0-5,is that right

@jatrost
Copy link
Contributor

jatrost commented Jul 15, 2013

yes this looks correct to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants