Vagrant Aerospike Java客户端EOFEException
我正在尝试连接到Aerospike单节点,我是使用MacOSX上的Vagrant设置的。我的AMC正在本地主机2200上运行。我无法成功连接到它Vagrant Aerospike Java客户端EOFEException,vagrant,aerospike,Vagrant,Aerospike,我正在尝试连接到Aerospike单节点,我是使用MacOSX上的Vagrant设置的。我的AMC正在本地主机2200上运行。我无法成功连接到它 import com.aerospike.client.AerospikeClient; public class AerospikeDriver { public static void main(String[] args) { AerospikeClient client = new AerospikeClient("1
import com.aerospike.client.AerospikeClient;
public class AerospikeDriver {
public static void main(String[] args) {
AerospikeClient client = new AerospikeClient("127.0.0.1", 2200);
client.close();
}
}
我在第一行中得到了这个错误。我也试着把端口改成3000。同样的错误。有时候,我也会有袜子例外
Exception in thread "main" com.aerospike.client.AerospikeException$Connection: Error Code -8: Failed to connect to host(s):
127.0.0.1 2200 Error Code -1: java.io.EOFException
at com.aerospike.client.cluster.Cluster.seedNodes(Cluster.java:532)
at com.aerospike.client.cluster.Cluster.tend(Cluster.java:425)
at com.aerospike.client.cluster.Cluster.waitTillStabilized(Cluster.java:380)
at com.aerospike.client.cluster.Cluster.initTendThread(Cluster.java:286)
at com.aerospike.client.cluster.Cluster.<init>(Cluster.java:243)
at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:234)
at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:175)
at AerospikeDriver.main(AerospikeDriver.java:5)
线程“main”com.aerospike.client.AerospikeException$Connection中出现异常:错误代码-8:无法连接到主机:
127.0.0.1 2200错误代码-1:java.io.EOFException
位于com.aerospeck.client.cluster.cluster.seedNodes(cluster.java:532)
位于com.aerospeck.client.cluster.cluster.tend(cluster.java:425)
在com.aerospeck.client.cluster.cluster.waitTills上(cluster.java:380)
位于com.aerospeck.client.cluster.cluster.initTendThread(cluster.java:286)
位于com.aerospeck.client.cluster.cluster.(cluster.java:243)
在com.aerospeck.client.aerospeckclient.(aerospeckclient.java:234)
在com.aerospeck.client.aerospeckclient.(aerospeckclient.java:175)
位于AerospikeDriver.main(AerospikeDriver.java:5)
我对aerospike客户端的maven依赖性如下:
<dependency>
<groupId>com.aerospike</groupId>
<artifactId>aerospike-client</artifactId>
<version>4.1.11</version>
</dependency>
com.aerospeak
aerospike客户端
4.1.11
这是我的aerospike形态:
# Aerospike database configuration file.
# This stanza must come first.
service {
user root
group root
paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
pidfile /var/run/aerospike/asd.pid
# service-threads 4
# transaction-queues 4
# transaction-threads-per-queue 4
proto-fd-max 15000
node-id-interface eth1
}
logging {
# Log file must be an absolute path.
file /var/log/aerospike/aerospike.log {
context any info
}
file /var/log/aerospike/udf.log {
context udf info
context aggr info
}
}
network {
service {
address eth1
port 3000
# access-address <Published IP>
# access-address <NAT IP>
}
heartbeat {
mode multicast
multicast-group 239.1.99.222
address eth1
port 9918
protocol v3
# To use unicast-mesh heartbeats, comment out the 3 lines above and
# use the following 4 lines instead.
# mode mesh
# port 3002
# mesh-address 10.1.1.1
# mesh-port 3002
interval 150
timeout 10
}
fabric {
port 3001
address eth1
}
info {
port 3003
}
}
#namespace test {
# replication-factor 2
# memory-size 4G
# default-ttl 30d # 30 days, use 0 to never expire/evict.
#
# storage-engine memory
#}
namespace test {
replication-factor 2
memory-size 2G
default-ttl 5d # 5 days, use 0 to never expire/evict.
# To use file storage backing, comment out the line above and use the
# following lines instead.
storage-engine device {
file /opt/aerospike/data/test.dat
filesize 5G
data-in-memory true # Store data in memory in addition to file.
}
}
#Aerospike数据库配置文件。
#这一节必须放在第一位。
服务{
用户根
群根
paxos单副本限制1#副本计数自动减少到1的节点数。
pidfile/var/run/aerospike/asd.pid
#服务线程4
#事务队列4
#每个队列4的事务线程
proto fd最大值15000
节点id接口eth1
}
伐木{
#日志文件必须是绝对路径。
文件/var/log/aerospike/aerospike.log{
上下文信息
}
文件/var/log/aerospike/udf.log{
上下文自定义项信息
上下文聚合信息
}
}
网络{
服务{
地址eth1
端口3000
#访问地址
#访问地址
}
心跳{
模式多播
多播组239.1.99.222
地址eth1
端口9918
协议v3
#要使用单播网格心跳,请注释掉上面和下面的3行
#改为使用以下4行。
#模式网格
#端口3002
#网状地址10.1.1.1
#网状端口3002
间隔150
超时10
}
织物{
端口3001
地址eth1
}
信息{
端口3003
}
}
#名称空间测试{
#复制因子2
#内存大小4G
#默认ttl 30d#30天,使用0永不过期/收回。
#
#存储引擎存储器
#}
名称空间测试{
复制因子2
内存大小2G
默认ttl 5d#5天,使用0永不过期/退出。
#要使用文件存储备份,请注释掉上面的行并使用
#改为跟着行。
存储引擎设备{
文件/opt/aerospeck/data/test.dat
文件大小5G
内存中的数据为真#除文件外,还将数据存储在内存中。
}
}
我做错了什么?这里需要帮助。我对aerospike很陌生。我试着到处找,但什么也找不到
更新
我现在使用IP地址172.28.128.4(从ifconfig命令获得)和端口3000连接到aerospike。我现在遇到套接字超时异常。如果您在Mac上的vagrant上设置了一个节点,并且您正在Mac上的ide中运行应用程序,那么eclipse-locoalhost on vagrant通常会以172.28.128.3的格式暴露在Mac上。在vagrant shell中运行ifconfig将证实这一点。如果应用程序在vagrant内部运行,那么127.0.0.1应该可以工作,在每种情况下,应用程序都应该指定端口3000。这就是aerospike服务器正在监听的地方。amc是一个Web服务器,在端口3000上与aerospike通信,默认情况下为端口8081上的仪表板提供服务。因此,它是通过网络浏览器连接aerospike的监控和管理网关。此外,在aerospike配置中,建议您使用mesh配置而不是多播,但对于单个节点来说,这并不重要-您没有创建集群。如果您是新手,如果您下载CE,您可以免费进入Aerospike Academy的Aerospike入门课程。充分利用这一点——几小时的投资。另外,这里有一些介绍视频在youtube上。(和)感谢您的回复。我尝试了以上所有的选择。IP地址是172.28.128.4。我给了港口3000英镑。我收到套接字超时异常。1-你的应用程序在mac上,aerospike在vagrant上运行?2-你试过写一张唱片吗?-什么aerospike版本?我想你的服务器没有启动。在namespace config中,在缺省ttl 5d条目之后的下一行中,添加:nsup period 30并重新启动服务器。1-是。应用程序在mac上,aerospike在vagrant 2上-我使用AQL成功地写了一个记录。我的aerospike版本4.8.0.5。我的应用程序中的aerospike客户端版本是4.4.11。3-服务器状态正在运行。我也尝试了你提出的解决方案。它对me不起作用。nsup-period要求适用于版本4.9+——这就解释了这一点。AQL在vagrant内部运行,所以服务器启动了,你不能从mac连接到它。我有和你一样的配置,我可以连接。当您使用vagrant up启动vagrant时-检查端口3000的端口转发:我有:默认值:转发端口。。。默认值:3000(来宾)=>3000(主机)(适配器1)默认值:8081(来宾)=>8081(主机)(适配器1)默认值:22(来宾)=>2222(主机)(适配器1)=>默认值:转发端口。。。默认值:3000(来宾)=>3000(主机)(适配器1)默认值:8081(来宾)=>2200(主机)(适配器1)默认值:22(来宾)=>2222(主机)(适配器1)