aerospike / aerospike-client-go

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

multiple cluster nodes is showing cluster timeout #391

Closed artman92 closed 1 year ago

artman92 commented 1 year ago

Client side code:

client, err := aerospike.NewClientWithPolicyAndHost(
    aerospike.NewClientPolicy(),
    aerospike.NewHost("127.0.0.1", 3000),
    aerospike.NewHost("127.0.0.1", 4000),
)

added aerospike configs as well:

service {
        user root
        group root

        pidfile /var/run/aerospike/asd.pid
        proto-fd-max 15000
}
logging {
        file /dev/null {
                context any info
        }
        console {
                context any info 
        }
}
network {
        service {
                address any
                port 3000
                access-address 172.18.0.3
        }
        heartbeat {
            address any
            mode mesh
            port 3002
            mesh-seed-address-port host.docker.internal 3002 # OK to have local node
            mesh-seed-address-port host.docker.internal 4002
            interval 150
            timeout 10
        }
        fabric {
            address any
                port 3001
        }
}
namespace abcd {
        replication-factor 2
        memory-size 1024M
        default-ttl 0 # 5 days, use 0 to never expire/evict.
        nsup-period 120
        storage-engine memory
        # To use file storage backing, comment out the line above and use the
        # following lines instead.
        storage-engine device {
                file /opt/aerospike/data/abcd.dat
                filesize 1G
                data-in-memory true # Store data in memory in addition to file.
        }
}
khaf commented 1 year ago

Sorry I saw your issue and went and tried to reproduce it, but failed to report back. It is not clear why you are encountering this issue, but it is not possible to reproduce it on my end. You have to make sure you can ping the address you are connecting to, and also make sure the server node internal addresses are available from outside their local network.

This means that if you run:

$ asinfo -h <host> -p <port>

the addresses in services field should be accessible from the client side. Failing this, please enable the client logging and set it to debug (you can look here to learn how to: https://github.com/aerospike/aerospike-client-go/blob/master/tools/benchmark/benchmark.go#L120) and then share the output.

khaf commented 1 year ago

Closing this due to inactivity. Feel free to reopen it or issue a new ticket in case you had further questions.