How to install Redis server on Ubuntu 17.04
How to install Redis server on Ubuntu 17.04
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. It also supports built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster. This tutorial will explain on how to install Redis server on Ubuntu 17.04.
Installation procedure
To start the installation process, execute the following command to install the Redis package as shown below.
root@linuxhelp1:~# apt-get install redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libjemalloc1 redis-tools
Suggested packages:
ruby-redis
.
.
.
Created symlink /etc/systemd/system/multi-user.target.wants/redis-server.service &rarr /lib/systemd/system/redis-server.service.
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (232-21ubuntu2) ...
The Redis package has been successfully installed. Now install the php-redis package by running the following command.
root@linuxhelp1:~# apt-get install php-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
php-common php-igbinary php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-phpdbg
php7.0-readline
.
.
.
Creating config file /etc/php/7.0/phpdbg/php.ini with new version
Setting up php-igbinary (2.0.1-1) ...
Setting up php-redis (3.1.1-1) ...
Run the following command to open the configuration file in vim editor. Add the following statements in Redis configuration file. Save and exit from the file.
root@linuxhelp1:~# vim /etc/redis/redis.conf
maxmemory 128mb
maxmemory-policy allkeys-lru
The configuration file is saved with the changes. Now restart and enable the Redis service.
root@linuxhelp1:~# systemctl restart redis-server.service root@linuxhelp1:~# systemctl enable redis-server.service
Now the Redis server is ready, run the below command to access Redis application.
root@linuxhelp1:~# redis-cli
127.0.0.1:6379>
The Redis terminal is logged on, now the user can manage the database by using Redis server.
Wasn' t that an easy installation procedure? The Redis server influence queues, leaderboards, pub/sub, session cache and full page cache.
Comments ( 0 )
No comments available