bq: Shouldn't this: &node=x.x.x.x:9001_solr <http://x.x.x.x:8984/solr/admin/collections?action=ADDREPLICA&collection=test2&shard=shard1&node=x.x.x.x:9001_solr>
Actually be this? &node=x.x.x.x:9001/solr <http://x.x.x.x:8984/solr/admin/collections?action=ADDREPLICA&collection=test2&shard=shard1&node=x.x.x.x:9001_solr> (Note the / instead of _ ) Good thing you added the note, 'cause I was having trouble seeing the difference. No. The underscore is correct. The "node" in this case is the name registered in Zookeeper in the "live nodes" znode, _not_ a URL or whatever... As to your two methods of moving a shard around. Either one is fine, although the first one (copying the directory and "doing the right thing" to edit core.properties) is a little dicier in that you're doing hand edits. Personally I prefer the ADDREPLICA solution. In fact I've moved replicas around by ADDREPLICA, wait, DELETEREPLICA... Best, Erick On Fri, Apr 15, 2016 at 3:10 AM, Jaroslaw Rozanski <s...@jarekrozanski.com> wrote: > Hi, > > Does the `&name=...` actually work for you? When attempting similar with > Solr 5.3.1, despite what documentation said, I had to use > `node_name=...`. > > > Thanks, > Jarek > > On Fri, 15 Apr 2016, at 05:48, John Bickerstaff wrote: >> Another thought - again probably not it, but just in case... >> >> Shouldn't this: &node=x.x.x.x:9001_solr >> <http://x.x.x.x:8984/solr/admin/collections?action=ADDREPLICA&collection=test2&shard=shard1&node=x.x.x.x:9001_solr> >> >> Actually be this? &node=x.x.x.x:9001/solr >> <http://x.x.x.x:8984/solr/admin/collections?action=ADDREPLICA&collection=test2&shard=shard1&node=x.x.x.x:9001_solr> >> >> (Note the / instead of _ ) >> >> On Thu, Apr 14, 2016 at 10:45 PM, John Bickerstaff >> <j...@johnbickerstaff.com >> > wrote: >> >> > Jay - it's probably too simple, but the error says "not currently active" >> > which could, of course, mean that although it's up and running, it's not >> > listening on the port you have in the command line... Or that the port is >> > blocked by a firewall or other network problem. >> > >> > I note that you're using ports different from the default 8983 for your >> > Solr instances... >> > >> > You probably checked already, but I thought I'd mention it. >> > >> > >> > On Thu, Apr 14, 2016 at 8:30 PM, John Bickerstaff < >> > j...@johnbickerstaff.com> wrote: >> > >> >> Thanks Eric! >> >> >> >> I'll look into that immediately - yes, I think that cURL would qualify as >> >> scriptable for my IT lead. >> >> >> >> In the end, I found I could do it two ways... >> >> >> >> Either copy the entire solr data directory over to /var/solr/data on the >> >> new machine, change the directory name and the entries in the >> >> core.properties file, then start the already-installed Solr in cloud mode >> >> - >> >> everything came up roses in the cloud section of the UI - the new replica >> >> was there as part of the collection, properly named and worked fine. >> >> >> >> Alternatively, I used the command I mentioned earlier and then waited as >> >> the data was replicated over to the newly-created replica -- again, >> >> everything was roses in the Cloud section of the Admin UI... >> >> >> >> What might I have messed up in this scenario? I didn't love the hackish >> >> feeling either, but had been unable to find anything like the addreplica - >> >> although I did look for a fairly long time - I'm glad to know about it >> >> now. >> >> >> >> >> >> >> >> On Thu, Apr 14, 2016 at 7:36 PM, Erick Erickson <erickerick...@gmail.com> >> >> wrote: >> >> >> >>> bq: the Solr site about how to add a >> >>> replica to a Solr cloud. The Admin UI appears to require that the >> >>> directories be created anyway >> >>> >> >>> No, no, a thousand times NO! You're getting confused, >> >>> I think, with the difference between _cores_ and _collections_ >> >>> (or replicas in a collection). >> >>> >> >>> Do not use the admin UI for _cores_ to create replicas. It's possible >> >>> if (and only if) you do it exactly correctly. Instead, use the >> >>> collections API >> >>> ADDREPLICA command here: >> >>> >> >>> https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api_addreplica >> >>> >> >>> Which you could cURL etc., does that qualify as "scripting" in your >> >>> situation? >> >>> >> >>> You're right, the Solr instance must be up and running for the replica to >> >>> be added, but that's not onerous.... >> >>> >> >>> >> >>> The bin/solr script is a "work in progress", and doesn't have direct >> >>> support >> >>> for "addreplica", but it could be added. >> >>> >> >>> Best, >> >>> Erick >> >>> >> >>> On Thu, Apr 14, 2016 at 6:22 PM, John Bickerstaff >> >>> <j...@johnbickerstaff.com> wrote: >> >>> > Sure - couldn't agree more. >> >>> > >> >>> > I couldn't find any good documentation on the Solr site about how to >> >>> add a >> >>> > replica to a Solr cloud. The Admin UI appears to require that the >> >>> > directories be created anyway. >> >>> > >> >>> > There is probably a way to do it through the UI, once Solr is >> >>> installed on >> >>> > a new machine - and IIRC, I did manage that, but my IT guy wanted >> >>> > scriptable command lines. >> >>> > >> >>> > Also, IIRC, the stuff I did on the command line actually showed the >> >>> API URL >> >>> > as part of the output so Jay could try that and see what the difference >> >>> > is... >> >>> > >> >>> > Jay - I'm going offline now, but if you're still stuck tomorrow, I'll >> >>> try >> >>> > to recreate... I have a VM snapshot just before I issued the command... >> >>> > >> >>> > Keep in mind everything I did was in a Solr Cloud... >> >>> > >> >>> > On Thu, Apr 14, 2016 at 6:21 PM, Jeff Wartes <jwar...@whitepages.com> >> >>> wrote: >> >>> > >> >>> >> I’m all for finding another way to make something work, but I feel >> >>> like >> >>> >> this is the wrong advice. >> >>> >> >> >>> >> There are two options: >> >>> >> 1) You are doing something wrong. In which case, you should probably >> >>> >> invest in figuring out what. >> >>> >> 2) Solr is doing something wrong. In which case, you should probably >> >>> >> invest in figuring out what, and then file a bug so it doesn’t happen >> >>> to >> >>> >> anyone else. >> >>> >> >> >>> >> Adding a replica is a pretty basic operation, so whichever option is >> >>> the >> >>> >> case, I feel like you’ll just encounter other problems down the road >> >>> if you >> >>> >> don’t figure out what’s going on. >> >>> >> >> >>> >> I’d probably start by creating the single-replica collection, and then >> >>> >> inspecting the live_nodes list in Zookeeper to confirm that the >> >>> (live) node >> >>> >> list is actually what you think it is. >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> On 4/14/16, 4:04 PM, "John Bickerstaff" <j...@johnbickerstaff.com> >> >>> wrote: >> >>> >> >> >>> >> >5.4 >> >>> >> > >> >>> >> >This problem drove me insane for about a month... >> >>> >> > >> >>> >> >I'll send you the doc. >> >>> >> > >> >>> >> >On Thu, Apr 14, 2016 at 5:02 PM, Jay Potharaju < >> >>> jspothar...@gmail.com> >> >>> >> >wrote: >> >>> >> > >> >>> >> >> Thanks John, which version of solr are you using? >> >>> >> >> >> >>> >> >> On Thu, Apr 14, 2016 at 3:59 PM, John Bickerstaff < >> >>> >> >> j...@johnbickerstaff.com> >> >>> >> >> wrote: >> >>> >> >> >> >>> >> >> > su - solr -c "/opt/solr/bin/solr create -c statdx -d >> >>> /home/john/conf >> >>> >> >> > -shards 1 -replicationFactor 2" >> >>> >> >> > >> >>> >> >> > However, this won't work by itself. There is some preparation >> >>> >> >> > necessary... I'll send you the doc. >> >>> >> >> > >> >>> >> >> > On Thu, Apr 14, 2016 at 4:55 PM, Jay Potharaju < >> >>> jspothar...@gmail.com >> >>> >> > >> >>> >> >> > wrote: >> >>> >> >> > >> >>> >> >> > > Curious what command did you use? >> >>> >> >> > > >> >>> >> >> > > On Thu, Apr 14, 2016 at 3:48 PM, John Bickerstaff < >> >>> >> >> > > j...@johnbickerstaff.com> >> >>> >> >> > > wrote: >> >>> >> >> > > >> >>> >> >> > > > I had a hard time getting replicas made via the API, once I >> >>> had >> >>> >> >> created >> >>> >> >> > > the >> >>> >> >> > > > collection for the first time.... although that may have been >> >>> >> >> ignorance >> >>> >> >> > > on >> >>> >> >> > > > my part. >> >>> >> >> > > > >> >>> >> >> > > > I was able to get it done fairly easily on the Linux command >> >>> line. >> >>> >> >> If >> >>> >> >> > > > that's an option and you're interested, let me know - I have >> >>> a >> >>> >> rough >> >>> >> >> > but >> >>> >> >> > > > accurate document. But perhaps others on the list will have >> >>> the >> >>> >> >> > specific >> >>> >> >> > > > answer you're looking for. >> >>> >> >> > > > >> >>> >> >> > > > On Thu, Apr 14, 2016 at 4:19 PM, Jay Potharaju < >> >>> >> >> jspothar...@gmail.com> >> >>> >> >> > > > wrote: >> >>> >> >> > > > >> >>> >> >> > > > > Hi, >> >>> >> >> > > > > I am using solr 5.5 and testing adding a new replica when >> >>> a solr >> >>> >> >> > > instance >> >>> >> >> > > > > comes up. When I run the following command I get an error. >> >>> I >> >>> >> have 1 >> >>> >> >> > > > replica >> >>> >> >> > > > > and trying to add another replica. >> >>> >> >> > > > > >> >>> >> >> > > > > >> >>> >> >> > > > > >> >>> >> >> > > > >> >>> >> >> > > >> >>> >> >> > >> >>> >> >> >> >>> >> >> >>> http://x.x.x.x:8984/solr/admin/collections?action=ADDREPLICA&collection=test2&shard=shard1&node=x.x.x.x:9001_solr >> >>> >> >> > > > > >> >>> >> >> > > > > Error: >> >>> >> >> > > > > > <str name="Operation addreplica caused >> >>> >> >> > > > > > >> >>> >> >> > > > > >> >>> >> >> > > > >> >>> >> >> > > >> >>> >> >> > >> >>> >> >> >> >>> >> >> >>> exception:">org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: >> >>> >> >> > > > > > At least one of the node(s) specified are not currently >> >>> >> active, >> >>> >> >> no >> >>> >> >> > > > action >> >>> >> >> > > > > > taken.</str> >> >>> >> >> > > > > > <lst name="exception"> >> >>> >> >> > > > > > <str name="msg">At least one of the node(s) specified >> >>> are not >> >>> >> >> > > currently >> >>> >> >> > > > > > active, no action taken.</str> >> >>> >> >> > > > > > <int name="rspCode">400</int> >> >>> >> >> > > > > > </lst> >> >>> >> >> > > > > > <lst name="error"> >> >>> >> >> > > > > > <lst name="metadata"> >> >>> >> >> > > > > > <str >> >>> >> >> name="error-class">org.apache.solr.common.SolrException</str> >> >>> >> >> > > > > > <str >> >>> >> >> > > >> >>> name="root-error-class">org.apache.solr.common.SolrException</str> >> >>> >> >> > > > > > </lst> >> >>> >> >> > > > > > <str name="msg">At least one of the node(s) specified >> >>> are not >> >>> >> >> > > currently >> >>> >> >> > > > > > active, no action taken.</str> >> >>> >> >> > > > > > <int name="code">400</int> >> >>> >> >> > > > > > </lst> >> >>> >> >> > > > > > </response> >> >>> >> >> > > > > >> >>> >> >> > > > > >> >>> >> >> > > > > But when i create a new collection with 2 replicas it works >> >>> >> fine. >> >>> >> >> > > > > As a side note my clusterstate.json is not updating >> >>> correctly. >> >>> >> Not >> >>> >> >> > sure >> >>> >> >> > > > if >> >>> >> >> > > > > that is causing an issue. >> >>> >> >> > > > > >> >>> >> >> > > > > Any suggestions why the Addreplica command is not >> >>> working. And >> >>> >> is >> >>> >> >> it >> >>> >> >> > > > > related to the clusterstate.json? If yes, how can i fix it? >> >>> >> >> > > > > >> >>> >> >> > > > > -- >> >>> >> >> > > > > Thanks >> >>> >> >> > > > > Jay >> >>> >> >> > > > > >> >>> >> >> > > > >> >>> >> >> > > >> >>> >> >> > > >> >>> >> >> > > >> >>> >> >> > > -- >> >>> >> >> > > Thanks >> >>> >> >> > > Jay Potharaju >> >>> >> >> > > >> >>> >> >> > >> >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> -- >> >>> >> >> Thanks >> >>> >> >> Jay Potharaju >> >>> >> >> >> >>> >> >> >>> >> >> >> >> >> >