Search code examples
exist-db

How to stop eXist-db safely on a distant linux server with its own IP?


During fast prototyping I don’t care about consistency and safety of the database (I use only test files). However, I would like to know the best practices for later use. At the moment, I can’t figure out how to stop eXist with the bin/shutdown.sh script if the app does not run on http://localhost:8080.

I was able to set another port for Jetty and it works. Of course, I start the app with bin/startup.sh. However, if I try to stop Jetty + eXist with bin/shutdown.sh, I got this error:

ERROR: HTTP server returned unexpected status: Origin http://localhost:8080 is not configured, perhaps you wanted http://[my IP]:8080
CAUSE: HTTP server returned unexpected status: Origin http://localhost:8080 is not configured, perhaps you wanted http://[my IP]:8080

I have tried to install the wrapper and eXist really runs since the system startup but I still can’t stop it safely (I can only kill it).

My app runs on port 8081, Ubuntu 14.04 machine.

UPDATE

If I run the app inside a screen session, than quit the session and use bin/shutdown.sh, it logs:

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xms128m -Xmx512m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=/home/honza/eXist-db/lib/endorsed -Dexist.home=/home/honza/eXist-db -jar /home/honza/eXist-db/start.jar shutdown
ERROR: HTTP server returned unexpected status: Not Found
CAUSE: HTTP server returned unexpected status: Not Found

If I use: java -jar start.jar shutdown --uri=xmldb:exist://[my IP]:8081/xmlrpc, it logs:

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xms128m -Xmx512m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=/home/honza/eXist-db/lib/endorsed -Dexist.home=/home/honza/eXist-db -jar /home/honza/eXist-db/start.jar shutdown
ERROR: HTTP server returned unexpected status: Not Found
CAUSE: HTTP server returned unexpected status: Not Found

If is use the wrapper method, which means eXist starts during the server startup and runs on the background, and use bin/shutdown.sh, it still logs the same.

If is use the wrapper method and try to shutdown the app with sudo java -jar start.jar shutdown --uri=xmldb:exist://[my IP]:8081/xmlrpc, it still logs the same. If I don’t use the static IP and use localhost instead, it still logs the same.

The only one working method is for me ctrl-c, according to @joewiz.


Solution

  • See "Shutting Down the Database" at http://exist-db.org/exist/apps/doc/deployment.xml#D2.2.5.8 for specifying a port:

    java -jar start.jar shutdown --uri=xmldb:exist://localhost:8081/xmlrpc
    

    Alternatively, use ctrl-c to stop the bin/startup.sh process.