aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
429 stars 199 forks source link

NewClient unable to connect to cluster: command execution timed out on client #384

Closed myronbb closed 1 year ago

myronbb commented 1 year ago

go v1.16.12 aerospike-client-go v6.2.1 aerospike-server v6.0.0.3

Here is the code connecting to the cluster:

import (
  aero "github.com/aerospike/aerospike-client-go/v6"
)
client, err := aero.NewClient("1.2.3.4", 3000)
if err != nil {
    panic(err)
}

I'm getting the following error: ResultCode: TIMEOUT, Iteration: 0, InDoubt: false, Node: <nil>: command execution timed out on client: See 'Policy.Timeout'

Port seems to be open:

$ telnet 1.2.3.4 3000
Trying 1.2.3.4...
Connected to 1.2.3.4.
Escape character is '^]'.

Here is the aerospike.conf:

service {
        proto-fd-max 15000
}
logging {
        console {
                context any info
        }
}
network {
        service {
                address any
                port 3000
        }
        heartbeat {
                mode mesh
                address 127.0.0.1
                port 3002
                mesh-seed-address-port 127.0.0.1 3002
                mesh-seed-address-port 127.0.0.2 3002
                mesh-seed-address-port 127.0.0.3 3002
                interval 150
                timeout 10
        }
        fabric {
                port 3001
        }
        info {
                port 3003
        }
}
namespace test {
        memory-size 2G
        replication-factor 2
        storage-engine device {
                device /dev/sdb
                write-block-size 128K # adjust block size to make it efficient for SSDs.
        }
}

confirmed service is ready on server as well: INFO (as): (as.c:420) service ready: soon there will be cake!

myronbb commented 1 year ago

nevermind, had to setup access-address in service config to the external ip. everything is working now. hope this helps someone else in the future