As described in https://griddb.net/en/blog/run-a-griddb-server-in-docker-desktop/,
I did,
docker pull griddbnet/griddb
and started docker image with,
docker run --hostname=localhost -d -t griddbnet/griddb
And I have downloaded the Sample Java code to test connection.
However, always got connection errors,
I have tried this,
Properties props = new Properties();
props.setProperty("notificationMember", "127.0.0.1:31999");
props.setProperty("clusterName", "dockerGridDB");
props.setProperty("user", "admin");
props.setProperty("password", "admin");
GridStore store = GridStoreFactory.getInstance().getGridStore(props);
Collection<String, Person> col = store.putCollection("col01", Person.class);
Also tried,
Properties props = new Properties();
props.setProperty("notificationMember", "localhost:31999");
props.setProperty("clusterName", "dockerGridDB");
props.setProperty("user", "admin");
props.setProperty("password", "admin");
GridStore store = GridStoreFactory.getInstance().getGridStore(props);
Collection<String, Person> col = store.putCollection("col01", Person.class);
But got this error,
Exception in thread "main" com.toshiba.mwcloud.gs.GSTimeoutException: [145028:JC_BAD_CONNECTION] Failover timed out (trialCount=120, failureMillis=120930, timeoutMillis=120000, reason=[145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information), historySize=121, historyOfTop10(trial, millisFromInitial, millisFromPrev, reason)=[(4, 2057, 1016, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (11, 9114, 1016, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (51, 49438, 1015, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (81, 79637, 1015, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (98, 96752, 1016, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (105, 103822, 1018, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (106, 104844, 1022, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (108, 106865, 1015, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (113, 111909, 1015, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)), (121, 119951, 1007, [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information))])
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.executeStatement(GridStoreChannel.java:1816)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.executeResolver(GridStoreChannel.java:1924)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.resolvePartitionId(GridStoreChannel.java:2115)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putContainer(SubnetGridStore.java:992)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putCollection(SubnetGridStore.java:1049)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putCollection(SubnetGridStore.java:797)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putCollection(SubnetGridStore.java:100)
at com.toshiba.mwcloud.gs.partitioned.PartStore.putCollection(PartStore.java:176)
at gridDbTest.SampleTest1.main(SampleTest1.java:36)
Caused by: com.toshiba.mwcloud.gs.common.GSConnectionException: [145028:JC_BAD_CONNECTION] Failed to connect (address=localhost/127.0.0.1:31999, reason=Connection refused: no further information)
at com.toshiba.mwcloud.gs.subnet.NodeConnection.<init>(NodeConnection.java:143)
at com.toshiba.mwcloud.gs.subnet.NodeConnectionPool.resolve(NodeConnectionPool.java:163)
at com.toshiba.mwcloud.gs.subnet.NodeResolver.updateConnectionAndClusterInfo(NodeResolver.java:644)
at com.toshiba.mwcloud.gs.subnet.NodeResolver.prepareConnectionAndClusterInfo(NodeResolver.java:529)
at com.toshiba.mwcloud.gs.subnet.NodeResolver.getPartitionCount(NodeResolver.java:205)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel$5.execute(GridStoreChannel.java:2118)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.executeStatement(GridStoreChannel.java:1687)
... 8 more
Caused by: java.net.ConnectException: Connection refused: no further information
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at com.toshiba.mwcloud.gs.subnet.NodeConnection.<init>(NodeConnection.java:130)