Don't know how to check if redis stats DB has been correctly set

252 views
Skip to first unread message

Olivier Anguenot

unread,
Aug 18, 2021, 5:45:22 AM8/18/21
to TURN Server (Open-Source project)
Hi, 

I configured a Coturn instance on Amazon EC2 and I try to access to the Redis stats DB directly from the EC2 instance.

In my turnconf, I put the following line:
redis-statsdb="ip=127.0.0.1 dbname=0 connect_timeout=30"

When launching Coturn, I see the following lines:

0: Redis supported

0: Redis DB async connection to be used: ip=127.0.0.1 dbname=0 connect_timeout=30

But after that, a long list of 

5: redis_reconnect: Re-connected to redis, async

5: redis_reconnect: Re-connected to redis, async

5: redis_reconnect: Re-connected to redis, async

10: redis_reconnect: Re-connected to redis, async

10: redis_reconnect: Re-connected to redis, async

10: redis_reconnect: Re-connected to redis, async

--> What does it mean ? Is there a problem accessing the redis database from Coturn ?

Then, I tried to connect using a JavaScript Node.Js app and have the following:

Redis error: { Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379

    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)

  errno: 'ECONNREFUSED',

  code: 'ECONNREFUSED',

  syscall: 'connect',

  address: '127.0.0.1',

  port: 6379 }

The same problem appears with redis-cli: Could not connect to Redis at 127.0.0.1:6379: Connection refused

So, my question is what mistake did I make ?

Thanks in advance

Olivier


Warren McDonald

unread,
Aug 19, 2021, 8:19:02 PM8/19/21
to TURN Server (Open-Source project)
Hi,

This seems like it may be an issue with the local redis server process.

I would step through the basics of:
1. ensure the process is running
2. make sure it is listening on the default port 6379 using netstat
3. check the redis server logs to see if there is some issue preventing normal operation
4. use a redis cli to connect to the same config as you have in the turnserver.conf, to confirm it is working.
5. the message does not imply an authentication issue, but check that the default redis conf is not using a password. 
    if it is, then add the password to the cli test and the turnserver.conf

Warren

Warren McDonald

unread,
Aug 19, 2021, 8:22:07 PM8/19/21
to TURN Server (Open-Source project)
and also check SE Linux mode. 

Set it to permissive to debug and get going, then figure out the correct config for redis turnserver before setting back to enforcing mode.

Olivier Anguenot

unread,
Aug 23, 2021, 3:29:11 AM8/23/21
to TURN Server (Open-Source project)
Thanks Warren,

Thanks for the information. I think I made progress with your information because as I didn't found any process listening to port 6379, I understood that redis-server was not installed on my EC2.

I installed it and restarted my turnserver and now 1/ there was no more the line redis_connect... and 2/ I saw requests when I made a test from a browser using redis-cli --stat

I will continue to check stat more in details.

Olivier

Olivier Anguenot

unread,
Aug 24, 2021, 3:26:10 AM8/24/21
to TURN Server (Open-Source project)
Hi Warren,

Everything is now working fine. I have access from my Node.JS application to the Turn Redis stats messages

Thanks for your inputs :-)
Reply all
Reply to author
Forward
0 new messages