我尝试使用脚本在 elasticsearch 中创建一个密钥库: 回声“$KEYSTORE_PASSWORD” | elasticsearch-keystore 创建-p
它不起作用,因为系统提示我再次重新输入密码。
在网上找不到任何解决方案。
搜索整个弹性文档以及网络...
Enter new password for the elasticsearch keystore (empty for no password): Enter same password again: Exception in thread "main" java.lang.IllegalStateException: unable to read from standard input; is standard input open and a tty attached?
at org.elasticsearch.cli.Terminal.read(Terminal.java:94)
at org.elasticsearch.cli.Terminal.readSecret(Terminal.java:106)
at org.elasticsearch.common.cli.KeyStoreAwareCommand.readPassword(KeyStoreAwareCommand.java:47)
at org.elasticsearch.cli.keystore.CreateKeyStoreCommand.execute(CreateKeyStoreCommand.java:41)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:94)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.Command.main(Command.java:50)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
echo "$KEYSTORE_PASSWORD" | path/to/elasticsearch-keystore add name_of_the_key -xf
创建:
echo "$KEYSTORE_PASSWORD" | path/to/elasticsearch-keystore create -x, --stdin
与 add 参数一起使用时,可以通过标准输入 (stdin) 传递设置值。用回车符或换行符分隔多个值