在没有用户输入的情况下启动 OrientDB

Start OrientDB without user input

我正在尝试在 AWS 上以分布式模式启动 OrientDB。

我有一个自动缩放组,可以根据需要创建新节点。创建节点时,它们以没有节点名称的默认配置开始。思路是节点名是随机生成的

我的问题是服务器启动并要求用户输入。

+---------------------------------------------------------------+
|         WARNING: FIRST DISTRIBUTED RUN CONFIGURATION          |
+---------------------------------------------------------------+
| This is the first time that the server is running as          |
| distributed. Please type the name you want to assign to the   |
| current server node.                                          |
|                                                               |
| To avoid this message set the environment variable or JVM     |
| setting ORIENTDB_NODE_NAME to the server node name to use.    |
+---------------------------------------------------------------+

Node name [BLANK=auto generate it]:

我不想设置节点名称,因为我需要一个随机名称,但服务器永远不会启动,因为它正在等待用户输入。

是否有我可以传递给 dserver.sh 的参数,它会通过此检查并生成随机节点名称?

您可以使用 ORIENTDB_NODE_NAME 变量创建一个随机字符串作为节点名称传递给 OrientDB。示例:

ORIENTDB_NODE_NAME=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)

有关此的更多信息,请查看:https://gist.github.com/earthgecko/3089509