solrapache-zookeepersolrcloud

Solr 9.1 Collection creation


I've installed zookeeper 3.7.1 and Solr 9.1 on three EC2s running Ubuntu 22.04.1 LTS in a solcrloud deployment. The zoo.cfg is as follows:

tickTime=2500
dataDir=/zookeeper
clientPort=2181
maxClientCnxns=80
initLimit=10
syncLimit=5
server.1=10.9.9.x:2888:3888
server.2=10.9.10.y:2888:3888
server.3=10.9.13.z:2888:3888
4lw.commands.whitelist=*

The Solr deployment is almost straight out of the box. The solr.xml is unmodified. Here is the section:

<solrcloud>
    <str name="host">${host:}</str>
    <int name="hostPort">${solr.port.advertise:0}</int>
    <str name="hostContext">${hostContext:solr}</str>

    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>

    <int name="zkClientTimeout">${zkClientTimeout:30000}</int>
    <int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int>
    <int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int>
    <str name="zkCredentialsProvider">${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider}</str>
    <str name="zkACLProvider">${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider}</str>
    <str name="zkCredentialsInjector">${zkCredentialsInjector:org.apache.solr.common.cloud.DefaultZkCredentialsInjector}</str>
    <bool name="distributedClusterStateUpdates">${distributedClusterStateUpdates:false}</bool>
    <bool name="distributedCollectionConfigSetExecution">${distributedCollectionConfigSetExecution:false}</bool>

</solrcloud>

The config in /etc/default/solr.in.sh is as follows:


SOLR_JETTY_HOST="0.0.0.0"
ZK_HOST="10.9.9.x:2181,10.9.13.y:2181,10.9.10.z:2181"
SOLR_JAVA_MEM="-Xms2G -Xmx4G"
SOLR_PID_DIR="/srv/apps_data/solrcloud"
SOLR_HOME="/srv/apps_data/solrcloud/data"
LOG4J_PROPS="/srv/apps_data/solrcloud/log4j2.xml"
SOLR_LOGS_DIR="/srv/apps_data/solrcloud/logs"
SOLR_PORT="8983"

# The following lines added by ./solr for enabling BasicAuth
SOLR_AUTH_TYPE="basic"
SOLR_AUTHENTICATION_OPTS="-Dsolr.httpclient.config=/srv/apps_data/solrcloud/data/basicAuth.conf"

I enabled basic authentication and everything looks good in all three Admin UIs. Zookeeper status is good and the three servers are now deployed in solrcloud mode. The security section is as follows:

Solr Admin UI - security section

So far so good.

I next create a config using an authenticated request using the basic authentication credentials, http://solr:solr@10.9.9.x:8983/solr/admin/configs?action=UPLOAD&name=calls with a zip file containing the two files

managed-schema.xml
solrconfig.xml

When I look at it under the zookeeper tree, /configs/calls, I see a little annotation {"trusted":true}. This all seems good so far.

The problem comes when trying to create a collection. I use the collections API V1, with 3 shards and 2 replicas, using the async approach

http://solr:solr@10.9.9.x:8983/solr/admin/collections?action=CREATE&name=calls&numShards=3&replicationFactor=2&collection.configName=calls&async=123456


    "1234562330250161386315": {
        "responseHeader": {
            "status": 0,
            "QTime": 0
        },
        "STATUS": "failed",
        "msg": "Error CREATEing SolrCore 'calls_shard1_replica_n1': Unable to create core [calls_shard1_replica_n1] Caused by: solr.XSLTResponseWriter"
    },

What am I missing here? My research indicates that the issue with the XSLTResponseWriter arises because of a lack of trust or authentication. What is the correct way to configure Solr 9.1 to allow collections to be created?

Any help will be greatly appreciated!!


Solution

  • I figured out the issue. In the release notes for 9.0, it makes the sort of passing comment

    In other words, solr won't work in cloud mode AT ALL until the out-of-the-box configuration is corrected. The required change needs to be made in /etc/default/solr.in.sh for my deployment on ubuntu, and requires enabling the scripting module.

    The following lines appear in the freshly-installed solr.in.sh file (in /etc/default),

    # The bundled plugins in the "modules" folder can easily be enabled as a comma-separated list in SOLR_MODULES variable
    # SOLR_MODULES=extraction,ltr
    

    In order to be able to use solrcloud and create collections, etc., the following line needs to be included:

    SOLR_MODULES="extraction,ltr,scripting"
    

    With this change, solrcloud works as expected!