gpt4 book ai didi

java - 与 Accumulo 的连接仅在初始化时挂起

转载 作者:可可西里 更新时间:2023-11-01 14:45:29 29 4
gpt4 key购买 nike

我在虚拟机中运行 Accumulo。这个 Groovy 脚本可以在 VM 内部正常连接,但在 VM 外部它会在第一个 println 语句处挂起。

String instance = "test"
String zkServers = "localhost:2181"
String principal = "root";
AuthenticationToken authToken = new PasswordToken("testing1234");

ZooKeeperInstance inst = new ZooKeeperInstance(instance, zkServers);
println "Attempting connection"
Connector conn = inst.getConnector(principal, authToken);
println "Connected!"

这是我在 Vagrant 中开放的端口列表:

config.vm.network "forwarded_port", guest: 2122, host: 2122
config.vm.network "forwarded_port", guest: 2181, host: 2181
config.vm.network "forwarded_port", guest: 2888, host: 2888
config.vm.network "forwarded_port", guest: 3888, host: 3888
config.vm.network "forwarded_port", guest: 4445, host: 4445
config.vm.network "forwarded_port", guest: 4560, host: 4560
config.vm.network "forwarded_port", guest: 6379, host: 6379
config.vm.network "forwarded_port", guest: 8020, host: 8020
config.vm.network "forwarded_port", guest: 8030, host: 8030
config.vm.network "forwarded_port", guest: 8031, host: 8031
config.vm.network "forwarded_port", guest: 8032, host: 8032
config.vm.network "forwarded_port", guest: 8033, host: 8033
config.vm.network "forwarded_port", guest: 8040, host: 8040
config.vm.network "forwarded_port", guest: 8042, host: 8042
config.vm.network "forwarded_port", guest: 8081, host: 8081
config.vm.network "forwarded_port", guest: 8082, host: 8082
config.vm.network "forwarded_port", guest: 8088, host: 8088
config.vm.network "forwarded_port", guest: 9000, host: 9000
config.vm.network "forwarded_port", guest: 9092, host: 9092
config.vm.network "forwarded_port", guest: 9200, host: 9200
config.vm.network "forwarded_port", guest: 9300, host: 9300
config.vm.network "forwarded_port", guest: 9997, host: 9997
config.vm.network "forwarded_port", guest: 9999, host: 9999
#config.vm.network "forwarded_port", guest: 10001, host: 10001
config.vm.network "forwarded_port", guest: 10002, host: 10002
config.vm.network "forwarded_port", guest: 11224, host: 11224
config.vm.network "forwarded_port", guest: 12234, host: 12234
config.vm.network "forwarded_port", guest: 19888, host: 19888
config.vm.network "forwarded_port", guest: 42424, host: 42424
config.vm.network "forwarded_port", guest: 49707, host: 49707
config.vm.network "forwarded_port", guest: 50010, host: 50010
config.vm.network "forwarded_port", guest: 50020, host: 50020
config.vm.network "forwarded_port", guest: 50070, host: 50070
config.vm.network "forwarded_port", guest: 50075, host: 50075
config.vm.network "forwarded_port", guest: 50090, host: 50090
config.vm.network "forwarded_port", guest: 50091, host: 50091
config.vm.network "forwarded_port", guest: 50095, host: 50095

为什么它不让我连接的任何想法?它只是挂起,甚至似乎永远不会超时。

最佳答案

我从邮件列表收到了这个回复,它清除了所有内容:

Could be that the Accumulo services are only listening on localhost and not the "external" interface for your VM. To get a connector, that's a call to a TabletServer which run on 9997 by default (and you have open).

Do a netstat -nape | fgrep 9997 | fgrep LISTEN in your VM and see what interface the server is bound to. I'd venture a guess that you just need to put the FQDN for your VM in $ACCUMULO_CONF_DIR/slaves (and masters, monitor, gc, tracers, for completeness) instead of localhost.

关于java - 与 Accumulo 的连接仅在初始化时挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34075582/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com