cassandra - Load balance solr search -


i trying implement search in datastax cassandra using solr. have 2 nodes running both cassandra , solr. able perform solr search using solrj. have hardcoded solr url of 1 of node. know configuration/code change need change solr nodes can chosen directly.

at stage, reading solrurl external file , passing argument httpsolrserver.

httpsolrserver solrserver = new httpsolrserver(solrurl); 

external file contains solrurl

solr.url=http://192.168.100.12:8983/solr/ 

also improvements can existing approach?

  • you can use lbhttpsolrserver (remember: use querying), allows provide several servers solrj use distribute queries.

  • if have solr cloud cluster, can use zookeeper-aware server in solrj queries automagically distributed.

  • third, can set regular http load balancer (such haproxy, varnish, etc.) distribute requests , handle new servers coming online , servers disappearing.

  • you read random line in file instead of 1 specific server, or use separator configuration line , split on separator , pick server on random. won't allow dynamically adjust weights depending on query times (which http load balancer do), work enough.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -