Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎08-04-2015

Re: unable to create Solr collection / index

I am facing the same issue when creating SOLR collection in my quickstart VM (error below) -

 

solrctl collection --create findrcoll -s 1
Error: can't discover Solr URI. Please specify it explicitly via --solr.

 

I also verified that solr server daemon is running. I am not using Cloudera Manager in my VM.
[cloudera@quickstart findrcoll]$ sudo service solr-server status
Solr server daemon is running                              [  OK  ]

 

Any help is appreciated. Thanks

AKB
Contributor
Posts: 50
Registered: ‎04-11-2018

Re: unable to create Solr collection / index

Is this a bug in CDH 5.15?

 

The same happens for me.

 

This works

solrctl --zk ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr instancedir --create ds-collection /tmp/ds-collection

  This gives me Solr url not found error:

solrctl --zk ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr collection --create ds-collection -s 2 -r 2

The above command used to work in older 5.1x versions. Please advise.  

AKB
Contributor
Posts: 50
Registered: ‎04-11-2018

Re: unable to create Solr collection / index

@bgooley  Please see my post above. Thanks.

AKB
Contributor
Posts: 50
Registered: ‎04-11-2018

Re: unable to create Solr collection / index

Anyone?

Cloudera Employee
Posts: 246
Registered: ‎01-09-2014

Re: unable to create Solr collection / index

Can you run with the --trace option and see if theres any indication of why the ZK_ENSEMBLE is not being used?

-pd
AKB
Contributor
Posts: 50
Registered: ‎04-11-2018

Re: unable to create Solr collection / index

solrctl --zk
ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr
collection --delete ds-collection --trace
Error: can't discover Solr URI. Please specify it explicitly via --solr.

AKB
Contributor
Posts: 50
Registered: ‎04-11-2018

Re: unable to create Solr collection / index

[ Edited ]

[centos@ip-172-31-81-167 data]$ solrctl --trace --zk ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr collection --delete ds-collection
+ shift 1
+ test 5 '!=' 0
+ case "$1" in
+ '[' 5 -gt 1 ']'
+ SOLR_ZK_ENSEMBLE=ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr
+ shift 2
+ test 3 '!=' 0
+ case "$1" in
+ break
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -z ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr ']'
+ SOLR_ADMIN_ZK_CMD='ZKCLI_JVM_FLAGS=${ZKCLI_JVM_FLAGS} LOG4J_PROPS=${SOLR_CONF_DIR}/log4j.properties ${SOLR_HOME}/bin/zkcli.sh -zkhost $SOLR_ZK_ENSEMBLE 2>&3'
+ '[' 3 -gt 0 ']'
+ test 3 '!=' 0
+ case "$1" in
+ '[' --delete = --list ']'
+ '[' --delete = --list-snapshots ']'
+ '[' 3 -gt 2 ']'
+ case "$2" in
++ echo --delete
++ tr '[a-z]-' '[A-Z] '
+ COL_ACTION=' DELETE'
++ echo DELETE
+ eval solr_webapi ''\''/admin/collections?action=DELETE&name=ds-collection'\'''
++ solr_webapi '/admin/collections?action=DELETE&name=ds-collection'
++ '[' -z '' ']'
+++ get_solr_protocol
++++ eval 'ZKCLI_JVM_FLAGS=${ZKCLI_JVM_FLAGS}' 'LOG4J_PROPS=${SOLR_CONF_DIR}/log4j.properties' '${SOLR_HOME}/bin/zkcli.sh' -zkhost '$SOLR_ZK_ENSEMBLE' '2>&3' -cmd get /clusterprops.json
+++++ ZKCLI_JVM_FLAGS=
+++++ LOG4J_PROPS=/etc/solr/conf/log4j.properties
+++++ /opt/cloudera/parcels/CDH-5.15.1-1.cdh5.15.1.p0.4/bin/../lib/solr//bin/zkcli.sh -zkhost ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr -cmd get /clusterprops.json
+++ SOLR_STATE='{"urlScheme":"http"}'
+++ echo '{"urlScheme":"http"}'
+++ grep -i urlScheme
+++ grep -q -i https
+++ echo http
++ local SOLR_PROTOCOL=http
+++ get_solr_state /live_nodes
+++ sed -ne 's#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'
++++ eval 'ZKCLI_JVM_FLAGS=${ZKCLI_JVM_FLAGS}' 'LOG4J_PROPS=${SOLR_CONF_DIR}/log4j.properties' '${SOLR_HOME}/bin/zkcli.sh' -zkhost '$SOLR_ZK_ENSEMBLE' '2>&3' -cmd ls /live_nodes
+++++ ZKCLI_JVM_FLAGS=
+++++ LOG4J_PROPS=/etc/solr/conf/log4j.properties
+++++ /opt/cloudera/parcels/CDH-5.15.1-1.cdh5.15.1.p0.4/bin/../lib/solr//bin/zkcli.sh -zkhost ip-172-31-90-165.ec2.internal:2181,ip-172-31-81-167.ec2.internal:2181,ip-172-31-92-169.ec2.internal:2181/solr -cmd ls /live_nodes
+++ SOLR_STATE='/live_nodes (5)
/live_nodes/ip-172-31-81-167.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-90-165.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-82-140.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-92-169.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-93-54.ec2.internal:8983_solr (0)'
+++ echo '/live_nodes (5)
/live_nodes/ip-172-31-81-167.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-90-165.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-82-140.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-92-169.ec2.internal:8983_solr (0)
/live_nodes/ip-172-31-93-54.ec2.internal:8983_solr (0)'
+++ grep -v '^/ '
++ for node in '`get_solr_state '\''/live_nodes'\'' | sed -ne '\''s#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'\''`' 'localhost:$SOLR_PORT'
++ curl -i --retry 5 -s -L -k --negotiate -u : http://ip-172-31-81-167.ec2.internal:8983/solr
++ for node in '`get_solr_state '\''/live_nodes'\'' | sed -ne '\''s#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'\''`' 'localhost:$SOLR_PORT'
++ curl -i --retry 5 -s -L -k --negotiate -u : http://ip-172-31-90-165.ec2.internal:8983/solr
++ for node in '`get_solr_state '\''/live_nodes'\'' | sed -ne '\''s#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'\''`' 'localhost:$SOLR_PORT'
++ curl -i --retry 5 -s -L -k --negotiate -u : http://ip-172-31-82-140.ec2.internal:8983/solr
++ for node in '`get_solr_state '\''/live_nodes'\'' | sed -ne '\''s#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'\''`' 'localhost:$SOLR_PORT'
++ curl -i --retry 5 -s -L -k --negotiate -u : http://ip-172-31-92-169.ec2.internal:8983/solr
++ for node in '`get_solr_state '\''/live_nodes'\'' | sed -ne '\''s#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'\''`' 'localhost:$SOLR_PORT'
++ curl -i --retry 5 -s -L -k --negotiate -u : http://ip-172-31-93-54.ec2.internal:8983/solr
++ for node in '`get_solr_state '\''/live_nodes'\'' | sed -ne '\''s#/live_nodes/\(.*:[0-9][0-9]*\).*$#\1#p'\''`' 'localhost:$SOLR_PORT'
++ curl -i --retry 5 -s -L -k --negotiate -u : http://localhost:/solr
++ '[' -n '' ']'
++ die 'Error: can'\''t discover Solr URI. Please specify it explicitly via --solr.'
++ '[' '!' -z 'Error: can'\''t discover Solr URI. Please specify it explicitly via --solr.' ']'
++ echo Error: 'can'\''t' discover Solr URI. Please specify it explicitly via --solr.
Error: can't discover Solr URI. Please specify it explicitly via --solr.

 

 

## Seems like the collection command is not working in CDH 5.15. Instancedir works fine with zk quoram.

Cloudera Employee
Posts: 246
Registered: ‎01-09-2014

Re: unable to create Solr collection / index

It looks like its failing contacting the solr nodes. are you able to run this successfully from the host where the solrctl command is running?

curl -i --retry 5 -s -L -k --negotiate -u : http://ip-172-31-82-140.ec2.internal:8983/solr

-pd
AKB
Contributor
Posts: 50
Registered: ‎04-11-2018

Re: unable to create Solr collection / index

Yes, running all commands on NN2 which happens to be a Solr node also. I was able to create the collections using the collections api, but solrctl works for some commands and just not the collections command. Maybe some bug, please check the code. Thanks

Cloudera Employee
Posts: 246
Registered: ‎01-09-2014

Re: unable to create Solr collection / index

Does the curl command I noted return an actual web page? From the output, it is possible there is something wrong with the curl binaries that you are using...

-pd
Announcements