samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
184 stars 124 forks source link

How to prevent for not loosing solr data #3556

Closed shahnawaz-ror closed 5 years ago

shahnawaz-ror commented 5 years ago

Hello all I have taken the fresh pull from https://github.com/samvera/hyrax And run the docker-compose build by doing some small changes with database file and settings.yml(For multitenant) . I got stuck with solr when I start the application by using docker-compose up -d and create some tenants and work that does work fine for me. If i do the docker-compose down my solr volumes also removes why any suggestions thank you so much in advance. My fedora data remain as it is.

   `version: '2'
    volumes:
      fcrepo:
      solr:
      db:
      redis:
      zk1:
      zk2:
      zk3:
      zkconf:
      app:

    networks:
      external:
      internal:

    services:
      zoo1:
        image: zookeeper
        restart: always
        environment:
          - ZOO_MY_ID=1
          - ZOO_SERVERS=server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
        expose:
          - 2181
          - 2888
          - 3888
        volumes:
          - zk1:/data
          - zkconf:/conf
        networks:
          internal:
           aliases:
             - zookeeper_cluster
      zoo2:
        image: zookeeper
        restart: always
        environment:
          - ZOO_MY_ID=2
          - ZOO_SERVERS=server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
        expose:
          - 2181
          - 2888
          - 3888
        volumes:
          - zk2:/data
          - zkconf:/conf
        networks:
          internal:
           aliases:
             - zookeeper_cluster
      zoo3:
        image: zookeeper
        restart: always
        environment:
          - ZOO_MY_ID=3
          - ZOO_SERVERS=server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
        expose:
          - 2181
          - 2888
          - 3888
        volumes:
          - zk3:/data
          - zkconf:/conf
        networks:
          internal:
           aliases:
             - zookeeper_cluster

      solr:
        image: solr
        command: solr -c -f -z zookeeper_cluster:2181
        depends_on:
          - zoo1
          - zoo2
          - zoo3
        expose:
          - 8983
        ports:
          - 8983:8983
        volumes:
          - .:/app
          - solr:/opt/solr/server/solr
        networks:
          internal:

      fcrepo:
        image: cbeer/fcrepo4:4.7
        expose:
          - 8080
        ports:
          - 8080:8080
        volumes:
          - fcrepo:/data
        environment:
          - JAVA_OPTS=${JAVA_OPTS} -Dfcrepo.modeshape.configuration="classpath:/config/file-simple/repository.json" -Dfcrepo.object.directory="/data/objects" -Dfcrepo.binary.directory="/data/binaries"
        networks:
          internal:

      db:
        image: postgres
        volumes:
          - db:/var/lib/postgresql/data
        networks:
          internal:

      app:
        build: .
        environment:
          - REDIS_HOST=redis
          - DATABASE_URL=postgresql://postgres@db/postgres
          - FEDORA_URL=http://fcrepo:8080/fcrepo/rest
          - SOLR_URL=http://solr:8983/solr/
          - SETTINGS__ACTIVE_JOB__QUEUE_ADAPTER=sidekiq
          - SETTINGS__MULTITENANCY__ADMIN_ONLY_TENANT_CREATION=true
          - SETTINGS__SOLR__URL=http://solr:8983/solr/
          - SETTINGS__ZOOKEEPER__CONNECTION_STR=zookeeper_cluster:2181/configs
          - RAILS_ENV=development
          - RAILS_SERVE_STATIC_FILES=true
          - RAILS_LOG_TO_STDOUT=true
          - SECRET_KEY_BASE=asdf
          - RAILS_CACHE_STORE_URL=memcache
    # version and location of fits are set in Dockerfile:
          - LD_LIBRARY_PATH=/opt/fits-1.0.5/tools/mediainfo/linux
        volumes:
          - .:/data
          - app:/data/tmp/uploads
        networks:
          internal:

      web:
        extends:
          service: app
        command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails server"
        depends_on:
          - db
          - solr
          - fcrepo
          - redis
          - zoo1
          - zoo2
          - zoo3
          - memcache
          - db_migrate
          - db_seed
        expose:
          - 3000
        ports:
          - 3000:3000

      workers:
        extends:
          service: app
        command: bundle exec sidekiq
        environment:
          - SETTINGS__FITS_PATH=/opt/fits-1.0.5/fits.sh
        depends_on:
          - db
          - solr
          - fcrepo
          - redis
          - zoo1
          - zoo2
          - zoo3
          - initialize_app
          - db_migrate

      initialize_app:
        extends:
          service: app
        restart: on-failure
        command: bundle exec rails zookeeper:upload
        depends_on:
          - zoo1
          - zoo2
          - zoo3

      db_migrate:
        extends:
          service: app
        restart: on-failure
        command: bundle exec rails db:migrate RAILS_ENV=development
        depends_on:
          - db

      db_seed:
        extends:
          service: app
        restart: on-failure
        command: bundle exec rake ebsco:default_seed_data["default_seed_data.json"]
        depends_on:
          - db

      redis:
        image: redis:3
        command: redis-server
        volumes:
          - redis:/data
        networks:
          internal:

      memcache:
        image: memcached
        networks:
          internal:`
jcoyne commented 5 years ago

Hyrax doesn't have a docker-compose.yml, can you point out the file that you are using?