How to set up a basic Redis cache for Hipchat Data Center
Reference configuration only
This article provides an example configuration to help you set up your Hipchat Data Center deployment, however third-party software might require extra configuration work to function in your environment. Atlassian provides best-effort to assist you with your deployment, but does not directly support these components.
Purpose
This article provides guidance on how to install and configure a basic Redis instance for use in a Small-Scale Hipchat Data Center environment.
In this guide, we will install Redis 3.2 on a CentOS 7 Linux server.
Before you begin, we recommend that you familiarize yourself with installing and configuring CentOS 7 using the Linux command line.
Prepare
- Make sure the system on which Redis will be installed meets the Hardware Requirements for the Data Stores Node.
- Download and install CentOS 7 on the server using the minimal ISO image.
Install the Extras Packages for Enterprise Linux (EPEL) package. This will set up the EPEL repository for installing Redis:
sudo yum -y install epel-release
Install and Configure
Install Redis from the EPEL repository.
sudo yum -y install redis
Start Redis and configure it to start automatically when the server boots up.
sudo systemctl start redis sudo systemctl enable redis
Test Redis to see if it is working. If you receive a
PONG
response, it means that the server is functioning and responding to commands.redis-cli ping PONG
As the root user, open
/etc/redis.conf
in a text editor to locate and set the following values (if they are not set already). Forrequirepass
, use an appropriate password instead of the (too easy to guess) "hipchat" in the example below.appendonly no appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-min-size 64mb auto-aof-rewrite-percentage 100 stop-writes-on-bgsave-error yes rdbcompression yes maxclients 10000 repl-timeout 60 tcp-keepalive 60 timeout 0 requirepass hipchat
In the same file, comment out the
bind
line provided below. This makes Redis listen on all interfaces for external connections.bind 127.0.0.1
Commenting out this setting allows Redis to listen on all available interfaces. Your organization's security policies may not allow this. Learn more about Redis security from the Redis project documentation.
Restart the Redis service.
sudo systemctl restart redis
Open port
6379
on the CentOS server's firewall to allow external connections.sudo firewall-cmd --add-port=6379/tcp --permanent sudo firewall-cmd --reload
As the root user, verify that Redis is listening for connections on port
6379
. Using the examples above, the expected output would look like the following:ss -antlp | grep 6379 LISTEN 0 128 *:6379 *:* users:(("redis-server",pid=1015,fd=5)) LISTEN 0 128 :::6379 :::* users:(("redis-server",pid=1015,fd=4))
Continue setting up the Data Center according to the guidelines in the Configure Hipchat Data Center Nodes documentation.