[
https://issues.apache.org/jira/browse/SLING-9118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17074066#comment-17074066
]
Carlos Munoz edited comment on SLING-9118 at 4/2/20, 8:21 PM:
--------------------------------------------------------------
Thanks for looking into this Robert. I followed your instructions but
unfortunately it is still not working for me. (Just s a heads up I also had to
build org.apache.sling/org.apache.sling.installer.provider.jcr/3.2.1-SNAPSHOT)
as it's being used in your featue branch.
One main difference is that I'm using a mongo replica set in my tests. Here is
the script I'm using to make it happen. I'm using podman to do this, but it
should be translatable to docker; all that is needed are three docker pods
running mongo which can talk to each other. See the attached
[^recreateSlingReplicaSet.sh]
was (Author: carlosmunoz):
Thanks for looking into this Robert. I followed your instructions but
unfortunately it is still not working for me. (Just s a heads up I also had to
build org.apache.sling/org.apache.sling.installer.provider.jcr/3.2.1-SNAPSHOT)
as it's being used in your featue branch.
One main difference is that I'm using a mongo replica set in my tests. Here is
the script I'm using to make it happen. I'm using podman to do this, but it
should be translatable to docker; all that is needed are three docker pods
running mongo which can talk to each other:
{{# Create (if necessary) a pod of 3 mongo instances at ports 30001~3}}
{{podman pod rm -f mongo-replica-set}}
{{podman pod create --name mongo-replica-set -p 30001 -p 30002 -p 30003}}
{{podman run -d --pod mongo-replica-set --name m1 mongo:3.6 mongod --port 30001
--replSet mongo-repl-set}}
{{podman run -d --pod mongo-replica-set --name m2 mongo:3.6 mongod --port 30002
--replSet mongo-repl-set}}
{{podman run -d --pod mongo-replica-set --name m3 mongo:3.6 mongod --port 30003
--replSet mongo-repl-set}}
{{# Configure the replica set by running a script in the primary mongo instance
(assumed to be running at port 30001)}}
{{MONGO_COMMANDS=$(cat <<-END}}
{{ db = (new Mongo('localhost:30001')).getDB('sling')}}
{{ config = {}}
{{ "_id" : "mongo-repl-set",}}
{{ "members" : [}}
{{ {}}
{{ "_id" : 0,}}
{{ "host" : "localhost:30001"}}
{{ },}}
{{ {}}
{{ "_id" : 1,}}
{{ "host" : "localhost:30002"}}
{{ },}}
{{ {}}
{{ "_id" : 2,}}
{{ "host" : "localhost:30003"}}
{{ }]}}
{{ }}}
{{ rs.initiate(config)}}
{{END}}
{{)}}
{{mongo --port 30001 --eval "$MONGO_COMMANDS"}}
> Sling fails to start when database exists but 'sling' directory is missing
> --------------------------------------------------------------------------
>
> Key: SLING-9118
> URL: https://issues.apache.org/jira/browse/SLING-9118
> Project: Sling
> Issue Type: Bug
> Reporter: Ben Radey
> Assignee: Robert Munteanu
> Priority: Major
> Attachments: drop-mongo.sh, recreateSlingReplicaSet.sh, run-mongo.sh,
> run-sling-initial.sh, run-sling-second.sh
>
>
> # Create a persistent mongodb to use with Sling.
> # Start sling using the mongodb.
> # Stop sling.
> # Remove 'sling' directory.
> # Attempt to restart sling. Ultimately, sling fails to start.
> ----
> Steps to reproduce with attached scripts:
> # Run [^run-mongo.sh] . This creates a MongoDB 3.6 container named
> _mongo-sling_
> # Run [^run-sling-initial.sh]. This starts up Sling in the oak_mongo runmode,
> shuts it down after it's (probably) started up
> # Run [^run-sling-second.sh]. This moves away the sling directory and starts
> up a new instance. This always fails
> For cleanup, the [^drop-mongo.sh] script stops and removes the _mongo-sling_
> container.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)