CrateDB绑定本地IP

时间:2018-11-13 13:29:23

标签: crate cratedb

我在同一群集中设置了3个节点。

是否有任何方法可以为只能从同一主机访问的单个createdb节点绑定本地ip?

我尝试了以下操作,但不起作用。

    crate01:
    image: crate
    container_name: raycrate01
    hostname: crate01
    volumes:
    - ~/docker-volumes/demo/data/crate:/data
    ports:
    - "4200:4200"
    - "4300:4300"
    - "5432:5432"
    environment:
        CRATE_HEAP_SIZE: 1g
    command: crate -Ccluster.name=cluster -Cnode.name=crate01 -Cnetwork.host=192.16.18.121 -Cnetwork.bind_host=192.16.18.121 -Cnetwork.publish_host=192.16.18.121  -Cgateway.recover_after_nodes=2 -Cgateway.recover_after_time=2m -Cgateway.expected_nodes=3 -Clicense.enterprise=false -Cdiscovery.zen.minimum_master_nodes=2

应用上述配置时获取异常

org.elasticsearch.bootstrap.StartupException: BindPostgresException[Failed to bind to [5432-5532]]; nested: BindException[Address not available];
at org.elasticsearch.bootstrap.StartupExceptionProxy.<init>(StartupExceptionProxy.java:31) ~[crate-app-3.1.2.jar:3.1.2]
at io.crate.bootstrap.CrateDB.init(CrateDB.java:159) ~[crate-app-3.1.2.jar:3.1.2]
at io.crate.bootstrap.CrateDB.execute(CrateDB.java:135) ~[crate-app-3.1.2.jar:3.1.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:85) ~[crate-app-3.1.2.jar:3.1.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.1.4.jar:3.1.2]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.1.4.jar:3.1.2]
at io.crate.bootstrap.CrateDB.main(CrateDB.java:88) ~[crate-app-3.1.2.jar:3.1.2]
at io.crate.bootstrap.CrateDB.main(CrateDB.java:81) ~[crate-app-3.1.2.jar:3.1.2]
Caused by: io.crate.protocols.postgres.BindPostgresException: Failed to bind to [5432-5532]
at io.crate.protocols.postgres.PostgresNetty.bindAddress(PostgresNetty.java:224) ~[crate-app-3.1.2.jar:3.1.2]
at io.crate.protocols.postgres.PostgresNetty.resolveBindAddress(PostgresNetty.java:191) ~[crate-app-3.1.2.jar:3.1.2]
at io.crate.protocols.postgres.PostgresNetty.doStart(PostgresNetty.java:153) ~[crate-app-3.1.2.jar:3.1.2]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:66) ~[crate-app-3.1.2.jar:3.1.2]
at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_181]
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) ~[?:1.8.0_181]
at org.elasticsearch.node.Node.start(Node.java:595) ~[crate-app-3.1.2.jar:3.1.2]
at org.elasticsearch.bootstrap.BootstrapProxy.start(BootstrapProxy.java:215) ~[crate-app-3.1.2.jar:3.1.2]
at org.elasticsearch.bootstrap.BootstrapProxy.init(BootstrapProxy.java:269) ~[crate-app-3.1.2.jar:3.1.2]
at io.crate.bootstrap.CrateDB.init(CrateDB.java:155) ~[crate-app-3.1.2.jar:3.1.2]
... 6 more
Caused by: java.net.BindException: Address not available
at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_181]
at sun.nio.ch.Net.bind(Net.java:433) ~[?:1.8.0_181]
at sun.nio.ch.Net.bind(Net.java:425) ~[?:1.8.0_181]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_181]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:130) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:558) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1358) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1019) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:366) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.29.Final.jar:4.1.29.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.29.Final.jar:4.1.29.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:446) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[netty-common-4.1.29.Final.jar:4.1.29.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]

0 个答案:

没有答案