본문 바로가기

리눅스

[리눅스] 최신 버전의 레디스(redis) 설치하기

728x90

최신 버전의 레디스(redis) 설치하기

 redis : A persistent key-value database

EPEL 및 YUM Utilities 패키지 설치

yum install -y epel-release yum-utils

remi 저장소 설치

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

remi 저장소를 활성화

yum-config-manager --enable remi

설치전 redis 버전 확인

yum info redis
$ yum info redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * epel: nrt.edge.kernel.org
 * extras: mirror.kakao.com
 * remi: ftp.riken.jp
 * remi-safe: ftp.riken.jp
 * updates: mirror.kakao.com
Available Packages
Name        : redis
Arch        : x86_64
Version     : 6.2.5
Release     : 1.el7.remi
Size        : 1.2 M
Repo        : remi
Summary     : A persistent key-value database
URL         : http://redis.io
License     : BSD
Description : Redis is an advanced key-value store. It is often referred to as a data
            : structure server since keys can contain strings, hashes, lists, sets and
            : sorted sets.
            :
            : You can run atomic operations on these types, like appending to a string;
            : incrementing the value in a hash; pushing to a list; computing set
            : intersection, union and difference; or getting the member with highest
            : ranking in a sorted set.
            :
            : In order to achieve its outstanding performance, Redis works with an
            : in-memory dataset. Depending on your use case, you can persist it either
            : by dumping the dataset to disk every once in a while, or by appending
            : each command to a log.
            :
            : Redis also supports trivial-to-setup master-slave replication, with very
            : fast non-blocking first synchronization, auto-reconnection on net split
            : and so forth.
            :
            : Other features include Transactions, Pub/Sub, Lua scripting, Keys with a
            : limited time-to-live, and configuration settings to make Redis behave like
            : a cache.
            :
            : You can use Redis from most programming languages also.

redis 설치

yum install -y redis

redis 버전

redis-cli --version
$ redis-cli --version
redis-cli 6.2.5

redis 서비스를 시작하고 부팅 시 자동으로 시작하도록 활성화

systemctl --now enable redis

레디스 설치 후 기본 구성 설정(redis default configuration settings)

TCP backlog 경고

sysctl -w net.core.somaxconn=1024

(또는)

echo "net.core.somaxconn = 1024" >> /etc/sysctl.conf

overcommit_memory 경고

sysctl -w vm.overcommit_memory=1

(또는)

echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf

THP 경고

echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local

 

728x90