Forum down



  • I have been playing with my test forum (DigitalOcean CentOS7) over the last couple days (no other users other than my own account). Anyway, this morning I went to login and cannot connect to my site ("Unable to connect" error). It's obviously down, but I cannot restart it. It must have gone down overnight because I played around a bit after I had logged out. Looks like a Redis problem but I have no idea where to start.

    Any ideas?

    [root@offroadbc nodebb]# ./nodebb restart
    NodeBB could not be restarted, as a running instance could not be found.
    [root@offroadbc nodebb]# ./nodebb start

    Starting NodeBB
    "./nodebb stop" to stop the NodeBB server
    "./nodebb log" to view server output
    "./nodebb restart" to restart NodeBB

    [root@offroadbc nodebb]# ./nodebb log

    Type Ctrl-C to exit

    [cluster] Child Process (2500) has exited (code: 1, signal: null)
    at errnoException (net.js:905:11)
    [cluster] Spinning up another process...
    at Object.afterConnect [as oncomplete] (net.js:896:19)
    27/12 13:35 [2502] - info: Time: Sun Dec 27 2015 13:35:39 GMT-0800 (PST)
    27/12 13:35 [2502] - info: Initializing NodeBB v0.9.3
    27/12 13:35 [2502] - error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
    at errnoException (net.js:905:11)
    at Object.afterConnect [as oncomplete] (net.js:896:19)
    3 restarts in 10 seconds, most likely an error on startup. Halting.


  • Plugin & Theme Dev

    @ron_jeremy check if redis is running...

    run redis-cli



  • @pichalite Thanks for the prompt reply!

    [root@offroadbc nodebb]# redis-cli
    Could not connect to Redis at 127.0.0.1:6379: Connection refused
    not connected>


  • Plugin & Theme Dev

    @ron_jeremy try starting redis using redis-server



  • @pichalite

    [root@offroadbc nodebb]# redis-server
    [2948] 27 Dec 14:06:42.369 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    [2948] 27 Dec 14:06:42.371 * Increased maximum number of open files to 10032 (it was originally set to 1024).
    .
    .-__ ''-._ _.- .. ''-._ Redis 2.8.19 (00000000/0) 64 bit
    .-.-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.-.|'_.-'| Port: 6379 |-. ._ / _.-' | PID: 2948-._ -._-./ .-' .-'
    |-._-.
    -.__.-' _.-'_.-'| |-.
    -._ _.-'_.-' | http://redis.io-._ -._-..-'.-' .-'
    |-._-.
    -.__.-' _.-'_.-'| |-.
    -._ _.-'_.-' |-._ -._-..-'.-' .-'
    -._-.
    .-' .-'
    -._ _.-'-.
    _.-'

    [2948] 27 Dec 14:06:42.372 # Server started, Redis version 2.8.19
    [2948] 27 Dec 14:06:42.372 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    [2948] 27 Dec 14:06:42.372 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    [2948] 27 Dec 14:06:42.372 * The server is now ready to accept connections on port 6379


  • Plugin & Theme Dev

    @ron_jeremy redis is up now. try redis-cli if it works then start NodeBB and it should work



  • @pichalite [root@offroadbc nodebb]# redis-cli
    Could not connect to Redis at 127.0.0.1:6379: Connection refused
    not connected>


  • Plugin & Theme Dev

    @ron_jeremy do you have a password setup for redis?



  • @pichalite Hmmm I can't remember. How can I check? Also, should I not be setting a redis password?


  • Plugin & Theme Dev

    @ron_jeremy nothing wrong with setting a password... you have to use the password to use redis-cli if you have one.

    check redis docs for how to



  • @pichalite will do. thx very much for all the help!



  • @pichalite I did some Googling and found my way to the redis.conf file in the etc folder. Inspecting the file I see the following line is commented out:

    " # requirepass foobared "

    Does this mean there was no password set for redis?


  • Plugin & Theme Dev



  • Can anyone else offer any pointers? I have no idea where to go from here :worried:



  • If you want I can take a look into it.
    PM me, if you like :)



  • Thx for offering to help! I prefer not to use PM so the solution is available to others, too! :relieved:



  • Can you run a netstat -ntlp to see if redis is actually running on your system?



  • @Peter-Zoltan-Keresztes

    [root@offroadbc ~]# netstat -ntlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1111/sshd
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1467/master
    tcp6 0 0 :::22 :::* LISTEN 1111/sshd
    tcp6 0 0 ::1:25 :::* LISTEN 1467/master



  • your redis server is not running. You need to start it first. I would suggest to run service redis-server start. Then check for redis with netstat -ntlp. Once the redis server is up and running then you can start the nodebb application



  • @Peter-Zoltan-Keresztes Hi Peter, thanks for the help! I ran the command per your instructions:

    [root@offroadbc /]# service redis-server start
    Redirecting to /bin/systemctl start redis-server.service
    Failed to start redis-server.service: Unit redis-server.service failed to load: No such file or directory.
    [root@offroadbc /]#


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.