Redis is an in-memory key-value store known for its flexibility, performance, and wide language support.
Image Environment on Bluvalt:
Redis Image support the following OS:
OS | Redis 4.0.9 | Redis 5.0.7 |
---|---|---|
Ubuntu 18 | Yes | Yes |
Ubuntu 16 | N/A | Yes |
Centos 7 | N/A | Yes |
Launch an Instance from an Image:
- Login into bluvalt horizon with your “username” and “password”.
- Then go to (Project -> Compute -> Instances).
- On Instances page, click Launch Instance button at the top right corner then, Launch Instance dialog will appear
Redis Directory:
- Redis main directory:
/etc/redis
- Log directory:
/var/log
- Redis configuration file:
/etc/redis/ redis.conf
Start Redis
Start up the systemd service by typing:
sudo systemctl start redis
To the service status type the following command:
sudo systemctl status redis
You should see something that looks like this:
Output
redis.service - Redis Server
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2016-05-11 14:38:08 EDT; 1min 43s ago Process: 3115 ExecStop=/usr/local/bin/redis-cli shutdown (code=exited, status=0/SUCCESS)
Main PID: 3124 (redis-server)
Tasks: 3 (limit: 512)
Memory: 864.0K
CPU: 179ms 6
CGroup: /system.slice/redis.service
└─3124 /usr/local/bin/redis-server 127.0.0.1:6379
Test Redis Functionality
To test functioning, connect to the Redis server with the command-line client:
redis-cli
In the prompt that follows, test connectivity by typing:
Ping
You should see output like the following:
PONG
Check that you can set keys by typing:
set test "It's working!"
You should see output like the following:
OK
Now, retrieve the value by typing:
get test
You should see output like the following:
"It's working!"
Exit the Redis prompt to get back to the shell:
exit
As a final test, let’s restart the Redis instance:
sudo systemctl restart redis
Now, connect with the client again and confirm that your test value is still available:
redis-cli
Now, retrieve the value by typing:
get test
The value of your key should still be accessible:
"It's working!"
Back out into the shell again when you are finished:
exit
Check Redis version:
redis-server -v
You should see output like the following:
Redis server v=5.0.7 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=fc287baa8bd5a7f0