Problem with API (Redis server error)


#1

When I run API and request localhost:5000, then I get response {“code”:“error”,“message”:“It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING”}. How fix this? Any suggestions?


#2

Seems like you’re not running redis,
docker run -d -p 6379:6379 --name redis1 redis
should solve the problem.

BTW. Take a look at docker compose files, especially infrastructure described in ep 1 I think, if you’re not using it you may run into same issues with mongo and rabbitmq.


#3

Shymon, thanks for response.
I used command: docker-compose -f mongo-rabbit-redis.yml up -d
File from: https://github.com/devmentors/DNC-DShop/blob/master/compose/mongo-rabbit-redis.yml

When I executed commaand docker ps, I see, that redis is running.

I run API and other microservices on ports: 10000 (API),10001 - 10007 (microservices), besause ports 5000-5007 are unavallible. I changed this settings in launchSettings.json in each projects. I don’t think, that would by problem, but I add this information.

Other microservices run correctly.


#4

I ran services on ports 300X, api on 3000 and had not problem with redis, you can double check if redis is accessible within scope of microservices by running redis-cli - it will try to connect to redis at default port 6379