Failed to start Redis Datastore Server (Ubuntu 16.04.1 LTS)

Solution 1:

I had the same issue and could not find a working solution anywhere. After some searching, the following fix worked for me ( Ubuntu 16.04 )

In /etc/systemd/system/redis.service add the following under the [Service] section.

Type=forking

Solution 2:

Open your service using whatever editor.

vim /etc/systemd/system/redis.service

Look at your [Service] section at ExecStart mine was:

ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf

Run this command to see what errors are occuring. Mine responded with this:

 Fatal error, can't open config file '/etc/redis/redis.conf'

So I just updated that line to this (where my actual config file was)

ExecStart=/usr/local/bin/redis-server /etc/redis/6379.conf

Which is where redis quickstart places it by default... :)

Solution 3:

In my case , the log directory (/var/log/redis) which I mention in /etc/redis/redis.conf file was not present

How I find the error

Try

/usr/local/bin/redis-server /etc/redis/redis.conf

This is same command present in my /etc/systemd/system/redis.service file

ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf

Solution

1) Create the log directory

sudo mkdir -p /var/log/redis

2) Give proper access to create and write logs

sudo chown redis:redis /var/log/redis

Try to start the service again

sudo service redis-server start 

or

sudo service redis start