Hi; There is a round robin process when assigning nodes at cluster. If you want to achieve what you want you should change your Solr start up order.
Thanks; Furkan KAMACI 2014-02-25 19:17 GMT+02:00 Shawn Heisey <s...@elyograg.org>: > On 2/25/2014 8:09 AM, Oliver Schrenk wrote: > > I want to run two logical instances (leader & replica) of Solr on each > physical > > machine (host_1 & host_2). > > > > Everything is running but the shard is replicated on the same physical > machine! > > Which doesn't work as a failover mechanism. So at the moment the layout > is as > > follows: > > Don't run multiple instances of Solr on one machine. Instead, run one > instance per machine and create the collection with the maxShardsPerNode > parameter set to 2 or whatever value you need. Running multiple > instances is a waste of memory, and Solr is perfectly capable of running > multiple indexes (cores) on one instance. When there is one Solr > instance per machine, SolrCloud will never put replicas on the same > machine unless you specifically build them that way with the CoreAdmin API. > > The way you've set it up, SolrCloud just sees that you have four Solr > instances. It does not know that they are on the same machine. As far > as it is concerned, they are entirely separate. > > You might think that it should be able to see that they have the same > hostname or IP address, but if we checked for that, we would lose a > *lot* of flexibility that users demand. It would be impossible to set > up test instances where they are all on the same machine. There are > probably other networking scenarios that wouldn't function properly. > > Something that would be a good idea is an optional config flag that > would make SolrCloud compare hostnames when building a collection and > avoid putting replicas on nodes where the hostname matches. Whether to > default this option to on or off is a whole separate discussion. > > Yet another whole separate discussion: You need three physical nodes for > a redundant zookeeper, but I see only one host (localhost) in your > zkHost parameter. > > Thanks, > Shawn > >