我使用discovery api和Zookeeper在docker容器中运行了一个Hazelcast集群。这一切都运行良好,集群启动并按预期工作。我的问题是将客户端从另一台服务器连接到群集。
集群将127.0.0.1和172.17.0.1作为集群地址返回给zookeeper,这意味着客户端在同一台机器上运行良好,但即使172.17.0.1映射在客户端的主机文件中,也不会从远程机器连接到Hz集群的服务器IP。
我已经尝试用net=host和-h启动容器,以使它返回一个我可以映射到客户机的hosts文件中的地址,但似乎没有任何工作。我是不是漏掉了什么?
下面是来自客户端的日志和堆栈跟踪
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java -Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar:/Users/oliverbuckley-salmon/IdeaProjects/sandpit/datagrid/target/classes:/Users/oliverbuckley-salmon/IdeaProjects/sandpit/domain/target/classes:/Users/oliverbuckley-salmon/.m2/repository/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-client/1.2.3/hbase-client-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-annotations/1.2.3/hbase-annotations-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/com/github/stephenc/findbugs/findbugs-annotations/1.3.9-1/findbugs-annotations-1.3.9-1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-common/1.2.3/hbase-common-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-protocol/1.2.3/hbase-protocol-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/oliverbuckley-salmon/.m2/repository/com/google/guava/guava/12.0.1/guava-12.0.1.jar:/Users/oliverbuckley-salmon/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:/Users/oliverbuckley-salmon/.m2/repository/io/netty/netty-all/4.0.23.Final/netty-all-4.0.23.Final.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar:/Users/oliverbuckley-salmon/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/htrace/htrace-core/3.1.0-incubating/htrace-core-3.1.0-incubating.jar:/Users/oliverbuckley-salmon/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar:/Users/oliverbuckley-salmon/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar:/Users/oliverbuckley-salmon/.m2/repository/org/jruby/jcodings/jcodings/1.0.8/jcodings-1.0.8.jar:/Users/oliverbuckley-salmon/.m2/repository/org/jruby/joni/joni/2.1.2/joni-2.1.2.jar:/Users/oliverbuckley-salmon/.m2/repository/com/yammer/metrics/metrics-core/2.2.0/metrics-core-2.2.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-auth/2.5.1/hadoop-auth-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/httpcomponents/httpclient/4.2.5/httpclient-4.2.5.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/httpcomponents/httpcore/4.2.4/httpcore-4.2.4.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/server/apacheds-kerberos-codec/2.0.0-M15/apacheds-kerberos-codec-2.0.0-M15.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/server/apacheds-i18n/2.0.0-M15/apacheds-i18n-2.0.0-M15.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/api/api-asn1-api/1.0.0-M20/api-asn1-api-1.0.0-M20.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/api/api-util/1.0.0-M20/api-util-1.0.0-M20.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-common/2.5.1/hadoop-common-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-annotations/2.5.1/hadoop-annotations-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/commons/commons-math3/3.1.1/commons-math3-3.1.1.jar:/Users/oliverbuckley-salmon/.m2/repository/xmlenc/xmlenc/0.52/xmlenc-0.52.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-net/commons-net/3.1/commons-net-3.1.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-el/commons-el/1.0/commons-el-1.0.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/avro/avro/1.7.4/avro-1.7.4.jar:/Users/oliverbuckley-salmon/.m2/repository/com/thoughtworks/paranamer/paranamer/2.3/paranamer-2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1.jar:/Users/oliverbuckley-salmon/.m2/repository/com/jcraft/jsch/0.1.42/jsch-0.1.42.jar:/Users/oliverbuckley-salmon/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/tukaani/xz/1.0/xz-1.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-core/2.5.1/hadoop-mapreduce-client-core-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-yarn-common/2.5.1/hadoop-yarn-common-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-yarn-api/2.5.1/hadoop-yarn-api-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/javax/xml/bind/jaxb-api/2.2.2/jaxb-api-2.2.2.jar:/Users/oliverbuckley-salmon/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar:/Users/oliverbuckley-salmon/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/oliverbuckley-salmon/.m2/repository/io/netty/netty/3.6.2.Final/netty-3.6.2.Final.jar:/Users/oliverbuckley-salmon/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Users/oliverbuckley-salmon/.m2/repository/com/hazelcast/hazelcast-all/3.7.2/hazelcast-all-3.7.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-framework/2.10.0/curator-framework-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-client/2.10.0/curator-client-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-x-discovery/2.10.0/curator-x-discovery-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-recipes/2.10.0/curator-recipes-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-test/2.10.0/curator-test-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar:/Users/oliverbuckley-salmon/.m2/repository/com/hazelcast/hazelcast-zookeeper/3.6.1/hazelcast-zookeeper-3.6.1.jar:/Users/oliverbuckley-salmon/.m2/repository/joda-time/joda-time/2.9.4/joda-time-2.9.4.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain com.example.datagrid.cachewarmer.CacheReader
2016-11-28 20:51:35 INFO TradeMapStore:64 - Trying to connect to HBase
2016-11-28 20:51:35 WARN NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2016-11-28 20:51:37.473 java[25412:2402206] Unable to load realm info from SCDynamicStore
2016-11-28 20:51:38 INFO RecoverableZooKeeper:120 - Process identifier=hconnection-0x53443251 connecting to ZooKeeper ensemble=138.68.147.208:2181
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:host.name=172.20.10.2
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.version=1.7.0_45
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.vendor=Oracle Corporation
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.home=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.class.path=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar:/Users/oliverbuckley-salmon/IdeaProjects/sandpit/datagrid/target/classes:/Users/oliverbuckley-salmon/IdeaProjects/sandpit/domain/target/classes:/Users/oliverbuckley-salmon/.m2/repository/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-client/1.2.3/hbase-client-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-annotations/1.2.3/hbase-annotations-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/com/github/stephenc/findbugs/findbugs-annotations/1.3.9-1/findbugs-annotations-1.3.9-1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-common/1.2.3/hbase-common-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hbase/hbase-protocol/1.2.3/hbase-protocol-1.2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/oliverbuckley-salmon/.m2/repository/com/google/guava/guava/12.0.1/guava-12.0.1.jar:/Users/oliverbuckley-salmon/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:/Users/oliverbuckley-salmon/.m2/repository/io/netty/netty-all/4.0.23.Final/netty-all-4.0.23.Final.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar:/Users/oliverbuckley-salmon/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/htrace/htrace-core/3.1.0-incubating/htrace-core-3.1.0-incubating.jar:/Users/oliverbuckley-salmon/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar:/Users/oliverbuckley-salmon/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar:/Users/oliverbuckley-salmon/.m2/repository/org/jruby/jcodings/jcodings/1.0.8/jcodings-1.0.8.jar:/Users/oliverbuckley-salmon/.m2/repository/org/jruby/joni/joni/2.1.2/joni-2.1.2.jar:/Users/oliverbuckley-salmon/.m2/repository/com/yammer/metrics/metrics-core/2.2.0/metrics-core-2.2.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-auth/2.5.1/hadoop-auth-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/httpcomponents/httpclient/4.2.5/httpclient-4.2.5.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/httpcomponents/httpcore/4.2.4/httpcore-4.2.4.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/server/apacheds-kerberos-codec/2.0.0-M15/apacheds-kerberos-codec-2.0.0-M15.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/server/apacheds-i18n/2.0.0-M15/apacheds-i18n-2.0.0-M15.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/api/api-asn1-api/1.0.0-M20/api-asn1-api-1.0.0-M20.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/directory/api/api-util/1.0.0-M20/api-util-1.0.0-M20.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-common/2.5.1/hadoop-common-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-annotations/2.5.1/hadoop-annotations-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/commons/commons-math3/3.1.1/commons-math3-3.1.1.jar:/Users/oliverbuckley-salmon/.m2/repository/xmlenc/xmlenc/0.52/xmlenc-0.52.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-net/commons-net/3.1/commons-net-3.1.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-el/commons-el/1.0/commons-el-1.0.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:/Users/oliverbuckley-salmon/.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/avro/avro/1.7.4/avro-1.7.4.jar:/Users/oliverbuckley-salmon/.m2/repository/com/thoughtworks/paranamer/paranamer/2.3/paranamer-2.3.jar:/Users/oliverbuckley-salmon/.m2/repository/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1.jar:/Users/oliverbuckley-salmon/.m2/repository/com/jcraft/jsch/0.1.42/jsch-0.1.42.jar:/Users/oliverbuckley-salmon/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/tukaani/xz/1.0/xz-1.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-core/2.5.1/hadoop-mapreduce-client-core-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-yarn-common/2.5.1/hadoop-yarn-common-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/hadoop/hadoop-yarn-api/2.5.1/hadoop-yarn-api-2.5.1.jar:/Users/oliverbuckley-salmon/.m2/repository/javax/xml/bind/jaxb-api/2.2.2/jaxb-api-2.2.2.jar:/Users/oliverbuckley-salmon/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar:/Users/oliverbuckley-salmon/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/oliverbuckley-salmon/.m2/repository/io/netty/netty/3.6.2.Final/netty-3.6.2.Final.jar:/Users/oliverbuckley-salmon/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Users/oliverbuckley-salmon/.m2/repository/com/hazelcast/hazelcast-all/3.7.2/hazelcast-all-3.7.2.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-framework/2.10.0/curator-framework-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-client/2.10.0/curator-client-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-x-discovery/2.10.0/curator-x-discovery-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-recipes/2.10.0/curator-recipes-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/curator/curator-test/2.10.0/curator-test-2.10.0.jar:/Users/oliverbuckley-salmon/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/Users/oliverbuckley-salmon/.m2/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar:/Users/oliverbuckley-salmon/.m2/repository/com/hazelcast/hazelcast-zookeeper/3.6.1/hazelcast-zookeeper-3.6.1.jar:/Users/oliverbuckley-salmon/.m2/repository/joda-time/joda-time/2.9.4/joda-time-2.9.4.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.library.path=/Users/oliverbuckley-salmon/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.io.tmpdir=/var/folders/sx/g9vbcw9d3j54gtj89n57g1fw0000gn/T/
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:java.compiler=<NA>
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:os.name=Mac OS X
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:os.arch=x86_64
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:os.version=10.11.6
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:user.name=oliverbuckley-salmon
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:user.home=/Users/oliverbuckley-salmon
2016-11-28 20:51:38 INFO ZooKeeper:100 - Client environment:user.dir=/Users/oliverbuckley-salmon/IdeaProjects/sandpit
2016-11-28 20:51:38 INFO ZooKeeper:438 - Initiating client connection, connectString=138.68.147.208:2181 sessionTimeout=90000 watcher=hconnection-0x534432510x0, quorum=138.68.147.208:2181, baseZNode=/hbase
2016-11-28 20:51:38 INFO ClientCnxn:975 - Opening socket connection to server 138.68.147.208/138.68.147.208:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-28 20:51:38 INFO ClientCnxn:852 - Socket connection established to 138.68.147.208/138.68.147.208:2181, initiating session
2016-11-28 20:51:38 INFO ClientCnxn:1235 - Session establishment complete on server 138.68.147.208/138.68.147.208:2181, sessionid = 0x1583b2a4dbb0183, negotiated timeout = 90000
2016-11-28 20:51:38 INFO TradeMapStore:68 - Connected to HBase
2016-11-28 20:51:38 INFO CacheReader:32 - Connecting to Hz cluster
Nov 28, 2016 8:51:38 PM com.hazelcast.config.AbstractXmlConfigHelper
WARNING: Name of the hazelcast schema location incorrect using default
Nov 28, 2016 8:51:39 PM com.hazelcast.core.LifecycleService
INFO: hz.client_0 [kappa-serving-layer] [3.7.2] HazelcastClient 3.7.2 (20161004 - 540b01c) is STARTING
2016-11-28 20:51:39 INFO CuratorFrameworkImpl:235 - Starting
2016-11-28 20:51:39 INFO ZooKeeper:438 - Initiating client connection, connectString=138.68.172.212:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@644fa139
2016-11-28 20:51:39 INFO ClientCnxn:975 - Opening socket connection to server 138.68.172.212/138.68.172.212:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-28 20:51:39 INFO ClientCnxn:852 - Socket connection established to 138.68.172.212/138.68.172.212:2181, initiating session
2016-11-28 20:51:39 INFO ClientCnxn:1235 - Session establishment complete on server 138.68.172.212/138.68.172.212:2181, sessionid = 0x15830869abd0077, negotiated timeout = 40000
2016-11-28 20:51:39 INFO ConnectionStateManager:228 - State change: CONNECTED
Nov 28, 2016 8:51:40 PM com.hazelcast.core.LifecycleService
INFO: hz.client_0 [kappa-serving-layer] [3.7.2] HazelcastClient 3.7.2 (20161004 - 540b01c) is STARTED
Nov 28, 2016 8:51:56 PM com.hazelcast.client.spi.impl.ClusterListenerSupport
WARNING: hz.client_0 [kappa-serving-layer] [3.7.2] Unable to get alive cluster connection, try in 0 ms later, attempt 1 of 2.
2016-11-28 20:52:07 INFO ClientCnxn:1096 - Client session timed out, have not heard from server in 26671ms for sessionid 0x15830869abd0077, closing socket connection and attempting reconnect
2016-11-28 20:52:07 INFO ConnectionStateManager:228 - State change: SUSPENDED
2016-11-28 20:52:09 INFO ClientCnxn:975 - Opening socket connection to server 138.68.172.212/138.68.172.212:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-28 20:52:09 INFO ClientCnxn:852 - Socket connection established to 138.68.172.212/138.68.172.212:2181, initiating session
2016-11-28 20:52:09 INFO ClientCnxn:1235 - Session establishment complete on server 138.68.172.212/138.68.172.212:2181, sessionid = 0x15830869abd0077, negotiated timeout = 40000
2016-11-28 20:52:09 INFO ConnectionStateManager:228 - State change: RECONNECTED
Nov 28, 2016 8:52:25 PM com.hazelcast.client.spi.impl.ClusterListenerSupport
WARNING: hz.client_0 [kappa-serving-layer] [3.7.2] Unable to get alive cluster connection, try in 0 ms later, attempt 2 of 2.
Nov 28, 2016 8:52:25 PM com.hazelcast.core.LifecycleService
INFO: hz.client_0 [kappa-serving-layer] [3.7.2] HazelcastClient 3.7.2 (20161004 - 540b01c) is SHUTTING_DOWN
2016-11-28 20:52:25 INFO CuratorFrameworkImpl:821 - backgroundOperationsLoop exiting
2016-11-28 20:52:25 INFO ZooKeeper:684 - Session: 0x15830869abd0077 closed
2016-11-28 20:52:25 INFO ClientCnxn:512 - EventThread shut down
Nov 28, 2016 8:52:25 PM com.hazelcast.core.LifecycleService
INFO: hz.client_0 [kappa-serving-layer] [3.7.2] HazelcastClient 3.7.2 (20161004 - 540b01c) is SHUTDOWN
Exception in thread "main" java.lang.IllegalStateException: Unable to connect to any address in the config! The following addresses were tried:[localhost/127.0.0.1:5703, /172.17.0.1:5701, /172.17.0.1:5702, /172.17.0.1:5703, localhost/127.0.0.1:5702, localhost/127.0.0.1:5701]
at com.hazelcast.client.spi.impl.ClusterListenerSupport.connectToCluster(ClusterListenerSupport.java:175)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl.start(ClientClusterServiceImpl.java:191)
at com.hazelcast.client.impl.HazelcastClientInstanceImpl.start(HazelcastClientInstanceImpl.java:379)
at com.hazelcast.client.HazelcastClientManager.newHazelcastClient(HazelcastClientManager.java:78)
at com.hazelcast.client.HazelcastClient.newHazelcastClient(HazelcastClient.java:72)
at com.example.datagrid.cachewarmer.CacheReader.main(CacheReader.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
进程完成,退出代码为1,下面是我用来启动容器的命令
docker run -p 5701:5701 -ti --add-host=a826d5422c4d:138.68.147.208 --net=host -h muhz1 --name muhz1 -d olibs/kappahz:v0.1
add host将映射Zookeeper for Hbase,我使用它作为Hz的底层数据库,这工作很好。
感谢您的帮助,感谢您收到的任何提示或提示。奥利弗
My issue is connecting a client to the cluster from another server.
我对动物园管理员了解不多,但我可以帮你。
首先,您需要知道您在客户端和服务器之间共享的是哪个网络。为此,您可以使用ifconfig
。
然后,您需要知道承载Hazelcast集群容器的服务器的IP地址(因为您使用docker的host
网络模式-这意味着您的容器直接使用主机的网络接口)。同样,您可以通过使用ifconfig
来获得这一点。让我们假设它是192.168.1.27
。
docker run -it --net=host --name hz1 -p 192.168.1.27:5701:5701 hazelcast/hazelcast
如果需要,请将另一个节点添加到群集:
docker run -it --net=host --name hz2 -p 192.168.1.27:5702:5701 hazelcast/hazelcast
现在,您可以将Hazelcast客户端指向192.168.1.27:5701
或192.168.1.27:5701
,它将连接到集群。希望这能帮上忙。
我们有一个Hazelcast节点集群,所有这些节点都运行在一个远程系统(具有许多节点的单个物理系统)上。我们希望从一个外部客户机连接到这个集群--一个Java应用程序,它使用如下代码连接到HazelCast: 其中,主机是远程的IP,端口是5701。 这仍然连接到本地主机(127.0.0.1)。我错过了什么? 编辑: 如果java客户端是本地系统上运行的唯一hazelcast应用程序,则它无法连接
问题内容: 遵循此示例:https : //docs.docker.com/engine/examples/mongodb/ 当尝试使用以下命令连接到mongoDB时:( 其中ip是boot2docker ip的名称)+ docker ps的端口号: 27017 / tcp 或-P 0.0.0.0:49155->27017/tcp 无论哪种方式,我都会收到以下错误: 警告:无法连接到ip:2701
设置为 运行返回 当尝试将数据库连接到///时,Dbeaver日志返回以下内容: 真的不知道如何使连接工作。SSH隧道显然可以工作,但是到db的连接失败了。我在另一个容器中运行了一个Spring Boot应用程序,并通过连接字符串将其连接起来。 对此有什么意见吗?是否没有映射到内部网络?
我创建了一个Dockerfile来在Docker中运行Docker: 启动容器并运行docker ps后,我得到:“无法连接到unix:///var/run/docker.sock.docker守护程序是否正在运行?" 我在容器中执行了命令dockerd,结果是: 启动守护程序时出错:初始化网络控制器时出错:获取控制器实例时出错:未能创建NAT链DOCKER:iptables失败:iptables
问题内容: 我创建了一个Dockerfile在Docker内部运行Docker: 启动容器并运行docker ps后,我得到:“无法通过unix:///var/run/docker.sock连接到Docker守护程序。Docker守护程序正在运行吗?” 我在容器内执行了命令dockerd: 错误启动守护程序:错误初始化网络控制器:错误获取控制器实例:无法创建NAT链DOCKER:iptables失
问题内容: 我为远程服务器编写了以下hbase客户端类: 它引发了一些异常: 您能告诉我为什么会引发异常,代码有什么问题以及如何解决它。 问题答案: 由于您的HBase服务器的hosts文件,因此会发生此问题。 您只需要编辑HBase服务器的/ etc / hosts文件。 从该文件中删除localhost条目,然后将localhost条目放在HBase服务器IP的前面。 例如,您的HBase服务