Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solr Image does not start without a docker volume #243

Open
skremdwd opened this issue Jul 19, 2024 · 0 comments
Open

Solr Image does not start without a docker volume #243

skremdwd opened this issue Jul 19, 2024 · 0 comments

Comments

@skremdwd
Copy link

skremdwd commented Jul 19, 2024

I am currently trying to start the official Solr container with a mounted path instead of a docker volume.

I am getting an error on startup that solr.xml and zoo.cfg are not writeable.
It seems that the issue is that those files are created with root:root and the owner is not changed correctly.

If I change the owner/mod o+rwx of both files, the container starts without an issue and more directories are created along them with the correct 1000:1000 UID/GID.

I am not sure what the issue is, it seems to me that this is done inside the Solr Dockerfile

But maybe it is not possible to use a mounted path with the current Dockerfile setup?
I would prefer a file over volume because it is not possible to move normal docker volumes outside of the root file system, e.g. to a network storage.

Issue Reproduction

Modified ansible part (master and slave are identical):

- name: Start Solr child container
  docker_container:
    name: solr-slave
    image: "{{ solr_image_prefix }}/{{ solr_image_repository }}:{{ solr_image_tag }}"
    pull: "{{ solr_image_pull }}"
    command:
      - solr
      - -f
      - "-Dmaster.enable=true"
      - "-Dslave.enable=true"
      - "-Dslave.masterUrl=http://solr-master:8983/solr"
      - "-Dslave.pollInterval={{ solr_slave_poll_interval }}"
      # This is the Solr instance used for queries, so we need to enable shards
      # However we want to use a whitelist so that only queries for configured shards are allowed
      - "-Dsolr.shardsWhitelist={{ solr_shards_whitelist | join(',') }}"
    detach: yes
    restart_policy: unless-stopped
    exposed_ports:
      - "8983"
    networks:
      - name: esgf
    networks_cli_compatible: yes
    volumes: ["/some-mount/solr-slave/data:/var/solr/data:rw"]
    state: started
    recreate: yes

First container start:

-rw-------. 1 root root 2180 Mar 24  2019 solr.xml

Changing permission:

sudo chown 1000:1000 solr.xml

Second container start:

-rw-------. 1 esgf esgf  2180 Mar 24  2019 solr.xml
-rw-------. 1 root     root      975 Feb 21  2019 zoo.cfg

Changing permission again:

sudo chown 1000:1000 zoo.cfg

Third and final container start:

drwxr-xr-x. 2 esgf esgf 4096 Jul 19 09:54 aggregations
drwxr-xr-x. 3 esgf esgf 4096 Jul 19 09:54 datasets
drwxr-xr-x. 3 esgf esgf 4096 Jul 19 09:54 files
-rw-------. 1 esgf esgf 2180 Mar 24  2019 solr.xml
-rw-------. 1 esgf esgf 975 Feb 21  2019 zoo.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant