You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "acdha (via GitHub)" <gi...@apache.org> on 2025/09/03 22:18:23 UTC

Re: [PR] SOLR-17690 Make solr zk tools read ZK_HOST environment [solr]

acdha commented on PR #3240:
URL: https://github.com/apache/solr/pull/3240#issuecomment-3250991010

   > Adding ZK_HOST=foo to solr.in.sh has the same effect as adding export ZK_HOST=foo to your shell. It comes very handy when e.g. running Solr as a container and you can configure a lot with just env instead of having to patch the CMD part. The CLI tools like zk cp behaves the same as when starting solr itself.
   
   This is what I expected but it wasn't working with Solr 9.9, which is very confusing since the [documentation implies that works for all `solr` commands](https://solr.apache.org/guide/solr/latest/deployment-guide/zookeeper-ensemble.html#updating-solr-include-files).
   
   ```bash
   $ podman run -it --rm --network bard -e SOLR_JAVA_MEM="-Xms2g" -e ZK_HOST=zk_1:2181 --entrypoint /bin/bash --user root solr:9
   root@a973aed5e1d0:/opt/solr-9.9.0# echo $ZK_HOST
   zk_1:2181
   root@a973aed5e1d0:/opt/solr-9.9.0# solr zk ls /
   Neither --zk-host or --solr-url parameters provided so assuming solr url is http://localhost:8983.
   
   ERROR: Server refused connection at: http://localhost:8983/solr/admin/info/system
   
   root@a973aed5e1d0:/opt/solr-9.9.0# solr zk ls -z $ZK_HOST /
   WARN  - 2025-09-03 22:15:00.082; org.apache.solr.common.cloud.SolrZkClient; Using default ZkCredentialsInjector. ZkCredentialsInjector is not secure, it creates an empty list of credentials which leads to 'OPEN_ACL_UNSAFE' ACLs to Zookeeper nodes
   WARN  - 2025-09-03 22:15:00.187; org.apache.solr.common.cloud.SolrZkClient; Using default ZkACLProvider. DefaultZkACLProvider is not secure, it creates 'OPEN_ACL_UNSAFE' ACLs to Zookeeper nodes
   configs
   overseer
   aliases.json
   live_nodes
   collections
   overseer_elect
   security.json
   node_roles
   clusterprops.json
   root@a973aed5e1d0:/opt/solr-9.9.0# echo "ZK_HOST=$ZK_HOST" >> $SOLR_INCLUDE
   root@a973aed5e1d0:/opt/solr-9.9.0# solr zk ls /
   Neither --zk-host or --solr-url parameters provided so assuming solr url is http://localhost:8983.
   
   ERROR: Server refused connection at: http://localhost:8983/solr/admin/info/system
   ```
   
   I can't speak to the other discussions but it would have removed some friction for me if setting ZK_HOST in our container definitions meant that all Solr-related tools would use it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org