loading...
Cover image for Installing Forem on Ubuntu 18.04 (Part 5 - Redis)

Installing Forem on Ubuntu 18.04 (Part 5 - Redis)

avalerionv profile image Dawood Khan Masood ・2 min read

If there is anything you would like me to change, please comment. This section of the guide assumes you have already installed ImageMagick from the previous article.

Do you read Alt Text?

Installing Redis

Use apt to install Redis from the official Ubuntu repositories. You can do so by typing:

$ sudo apt update
$ sudo apt install redis-server -y
Enter fullscreen mode Exit fullscreen mode

This will download and install Redis along with its dependencies.

Configuration

There is one important configuration change to make in the Redis configuration file. Open this file with nano by typing:

$ sudo nano /etc/redis/redis.conf
Enter fullscreen mode Exit fullscreen mode

Find the supervised directive. This will be set to no. Since you are running an operating system that uses the systemd, you need to change this:

...

# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
#   supervised no      - no supervision interaction
#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#   supervised auto    - detect upstart or systemd method based on
#                        UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
#       They do not enable continuous liveness pings back to your supervisor.

supervised systemd

...
Enter fullscreen mode Exit fullscreen mode

That is the only change you need to make at this point, so save and close it when you are finished.

Restart the Redis service to reflect the changes you have made to the configuration file:

$ sudo systemctl restart redis.service
Enter fullscreen mode Exit fullscreen mode

Testing Redis

Start by checking that the Redis service is running:

$ sudo systemctl status redis
Enter fullscreen mode Exit fullscreen mode

The output will be something like this:

● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-08-21 19:49:17 UTC; 3min 5s ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 15330 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 15333 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
 Main PID: 15344 (redis-server)
    Tasks: 4 (limit: 4671)
   CGroup: /system.slice/redis-server.service
           └─15344 /usr/bin/redis-server 127.0.0.1:6379
Enter fullscreen mode Exit fullscreen mode

You can see that Redis is running and is already enabled, meaning that it is set to start up every time the server boots.

Discussion

pic
Editor guide