如何在具有自己 IP 的远程 linux 服务器上安全地停止 eXist-db?

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

在快速原型制作过程中,我不关心数据库的一致性和安全性(我只使用测试文件)。但是,我想知道以后使用的最佳做法。目前,如果应用程序在 http://localhost:8080.

上没有 运行,我不知道如何使用 bin/shutdown.sh 脚本停止 eXist

我能够为 Jetty 设置另一个端口并且它有效。当然,我用 bin/startup.sh 启动应用程序。但是,如果我尝试使用 bin/shutdown.sh 停止 Jetty + eXist,我会收到此错误:

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

自系统启动以来,我已经尝试安装 wrapper 和 eXist 真的 运行s 但我仍然无法安全地停止它(我只能杀死它)。

我的应用 运行 在端口 8081 上,Ubuntu 14.04 机器。

更新

如果我 运行 应用程序在 screen 会话中,而不是退出会话并使用 bin/shutdown.sh,它会记录:

/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

如果我使用:java -jar start.jar shutdown --uri=xmldb:exist://[my IP]:8081/xmlrpc,它会记录:

/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

如果使用包装器方法,这意味着 eXist 在服务器启动期间启动,运行s 在后台启动,并且使用 bin/shutdown.sh,它仍然记录相同的内容。

如果使用包装器方法并尝试使用 sudo java -jar start.jar shutdown --uri=xmldb:exist://[my IP]:8081/xmlrpc 关闭应用程序,它仍然会记录相同的内容。如果我不使用静态 IP 而是使用 localhost,它仍然会记录相同的内容。

根据@joewiz 的说法,对我来说只有一种工作方法 ctrl-c

请参阅 http://exist-db.org/exist/apps/doc/deployment.xml#D2.2.5.8 处的 "Shutting Down the Database" 以指定端口:

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

或者,使用 ctrl-c 停止 bin/startup.sh 进程。