Closed gkulkarni32 closed 1 year ago
Hi, This image is running solr not solr cloud. Collections are a concept that only exists in solr cloud. You can see in the screenshots you provided that there is not "cloud" icon in the UI.
However, you can connect to the pod and run:
$ solr create gettingstarted
$ post -c gettingstarted /opt/bitnami/solr/example/exampledocs/*.xml
It will create example documents in the gettingstarted
core, later you cat retrieve them by browsing: http://localhost:8983/solr/gettingstarted/select?q=*%3A*
Thanks @rafariossaa , Understood. Couple more questions:
Hi,
1- It worked fine when I created the cores from the pod, but when i tried to do the same from UI, I get the following error:
As you can see in the form, you need to have the instanceDir
and dataDir
created before you can add the core. The instance directory need to have a structure and some files (solrconfig and schema.xml) created there.
Could you take a look to this ? Also the create_core
command indicates:
$ solr create_core -help
Usage: solr create_core [-c core] [-d confdir] [-p port] [-V]
When a configSet is used, this can be run from remote (non-Solr) hosts. If pointing at a non-configSet directory, this
must be run from the host that you wish to create the core on
-c <core> Name of core to create
-d <confdir> Configuration directory to copy when creating the new core, built-in options are:
_default: Minimal configuration, which supports enabling/disabling field-guessing support
sample_techproducts_configs: Example configuration with many optional features enabled to
demonstrate the full power of Solr
If not specified, default is: _default
Alternatively, you can pass the path to your own configuration directory instead of using
one of the built-in configurations, such as: bin/solr create_core -c mycore -d /tmp/myconfig
-p <port> Port of a local Solr instance where you want to create the new core
If not specified, the script will search the local system for a running
Solr instance and will use the port of the first server it finds.
-V Enable more verbose output.
As you can see -d
is used as source to copy from, but form the UI you don't have that option and it is needed to provide the files.
2- Is there a way to use a zookeeper with this? Can we pass a parameter to this container if we have set up one with zookeeper helm chart?
You can indicate the zookeeper nodes by using the environment variable ZK_HOST
. You can get more information here. But take into account that you will also need to start solr with -e cloud
parameter.
Hi @rafariossaa If having an external zookeeper works in SolrCloud mode, I would prefer to use Cloud mode.
Tried the below 2 things:
Started the solr nodes in normal mode. And then got into the container to start solr in 'SolrCloud' mode with external zookeeper. This works and starts another solr instance within the pod at a different port.
solr start -e cloud -z test-solr-zookeeper-headless:2181
Added the same command in the pod so the pod starts solr in 'Cloud' mode. This did not work as the script is interactive and needs some additional parameters to be set (like no of shards, no of nodes etc). Additionally this needs a different port to start SolrCloud (works like a different instance of solr within the pod)
So it looks like we will need to modify the run.sh
script to start Solr in Cloud mode, basically a modification to the image.
Thanks Geeta
Could you give it a try to this ?
docker-compose up
docker exec -it bitnami-docker-solr_solr_1 bash
/opt/bitnami/solr/bin/solr zk mkroot /solr -z zk1:2181,zk2:2181,zk3:2181
"/opt/bitnami/solr/bin/solr" start -cloud -p 8983 -z zk1:2181,zk2:2181,zk3:2181/solr -d /opt/bitnami/solr/server/ -f
http://localhost:8983
$ cat docker-compose.yml
version: '2'
services:
solr:
entrypoint: tail -f /dev/null
image: 'docker.io/bitnami/solr:8-debian-10'
environment:
- SOLR_CORE=my_core
- ZK_HOST="zk1:2181,zk2:2181,zk3:2181/solr"
ports:
- '8983:8983'
volumes:
- 'solr_data:/bitnami'
zk1:
image: 'docker.io/bitnami/zookeeper:3-debian-10'
ports:
- '2181'
volumes:
- zookeeper_data:/bitnami
environment:
- ZOO_SERVER_ID=1
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_SERVERS=zk1:2888:3888,zk2:2888:3888,zk3:2888:3888
zk2:
image: 'docker.io/bitnami/zookeeper:3-debian-10'
ports:
- '2181'
volumes:
- zookeeper2_data:/bitnami
environment:
- ZOO_SERVER_ID=2
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_SERVERS=zk1:2888:3888,zk2:2888:3888,zk3:2888:3888
zk3:
image: 'docker.io/bitnami/zookeeper:3-debian-10'
ports:
- '2181'
volumes:
- zookeeper3_data:/bitnami
environment:
- ZOO_SERVER_ID=3
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_SERVERS=zk1:2888:3888,zk2:2888:3888,zk3:2888:3888
volumes:
zookeeper_data:
driver: local
zookeeper2_data:
driver: local
zookeeper3_data:
driver: local
solr_data:
driver: local
This would be just a workaround, as you can see I am overriding the entrypoint
of the solr image.
This initialization for solr cloud should be handled by the image or maybe creating a specific image for solr cloud.
Thanks @rafariossaa As discussed, will wait for the bitnami image with Cloud mode.
Thanks Geeta
You are welcome. We have opened an internal task for this. We will come back as soon as we have news.
Sure, will wait for that update.
Not sure if it was addressed in bitnami/charts#4951 but we are going to transfer this issue to bitnami/containers
. @rafariossaa Could check it?
In order to unify the approaches followed in Bitnami containers and Bitnami charts, we are moving some issues in bitnami/bitnami-docker-<container>
repositories to bitnami/containers
.
Please follow bitnami/containers to keep you updated about the latest bitnami images.
More information here: https://blog.bitnami.com/2022/07/new-source-of-truth-bitnami-containers.html
Description
Steps to reproduce the issue:
Describe the results you received:
When I check the UI from the external IP that I received above, I do not see the collections dropdown. Core is created using the environement parameter i had provided. But I'm unable to create a new collection.
Describe the results you expected:
I expect to see the solr collections dropdown as shown below. This is not showing:
Additional information you deem important (e.g. issue happens only occasionally):
Version
docker version
:docker info
:docker-compose version
(if applicable):Additional environment details (AWS, VirtualBox, Docker for MAC, physical, etc.):