Upon creating AerospikeClient, I receive:
Aerospike.Client.AerospikeException.Connection
HResult=0x80131500
Message=Failed to connect to host(s):
localhost 3000 Error -1: An established connection was aborted by the software in your host machine
I've created a new Aerospike container that runs on my local machine with port 3000 with the following command:
docker run -d -p 3000:3000 aerospike/aerospike-server
and I've manage to connect it with AerospikeClient & AQL with the following command:
docker run -it aerospike/aerospike-tools aql -h 172.17.0.2 -p 3000
later on I played with the docker container commands (stop and start) and it still worked.
now for some reason it does not work anymore, I still manage to connect with AQL but not with the AerospikeClient.
asClient = new AerospikeClient(HostName, Port); //throws Exception
this is the full exception log:
Source=AerospikeClient
StackTrace:
at Aerospike.Client.Cluster.SeedNodes(Boolean failIfNotConnected)
at Aerospike.Client.Cluster.Tend(Boolean failIfNotConnected)
at Aerospike.Client.Cluster.WaitTillStabilized(Boolean failIfNotConnected)
at Aerospike.Client.Cluster.InitTendThread(Boolean failIfNotConnected)
at RestaurantDecider.DataAccess.AerospikeRestaurantRepo..ctor() in C:\Users\etianc\source\repos\AeroSpikeDemo\RestaurantDecider.DataAccess\AerospikeRestaurantRepo.cs:line 28
at AeroSpikeDemo.Program.Main(String[] args) in C:\Users\etianc\source\repos\AeroSpikeDemo\AeroSpikeDemo\Program.cs:line 30
I am not too familiar with Aerospike but from what I see you are running two separate containers - one is the "server" and the other is the client connecting to it. Things you need to consider when doing this without using docker-compose.yml
If I were you I would just use a docker-compose.yml file similar to this:
version: "3"
services:
server:
image: aerospike/aerospike-server
client:
depends_on:
- server
image: aerospike/aerospike-tools
command: ["aql", "-h", "172.17.0.2", "-p", "3000"]
But from what I see on the docker hub, you should use a custom configuration file and define access-address (see https://hub.docker.com/_/aerospike under access-address Configuration)
User contributions licensed under CC BY-SA 3.0