Redis를 설치해보쟈!
필요 Dependencies 설치
sudo apt update
sudo apt install build-essential tcl
Redis 7.2.5 Source Code 다운로드
cd /tmp
wget https://download.redis.io/releases/redis-7.2.5.tar.gz
Source Code 추출
tar xzf redis-7.2.5.tar.gz
cd redis-7.2.5
Redis 빌드
sudo make install
Redis 설정
sudo mkdir /etc/redis
sudo mkdir /var/lib/redis
sudo cp redis.conf /etc/redis
설정 수정
sudo nano /etc/redis/redis.conf
supervised systemd
dir /var/lib/redis
System Service 셋업
sudo nano /etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
Redis 유저 생성 및 Permissions 부여
sudo adduser --system --group --no-create-home redis
sudo chown redis:redis /var/lib/redis
sudo chmod 770 /var/lib/redis
Redis Service 시작 및 활성화
- Redis service 설정 systemd 리로드 하여 적용
sudo systemctl daemon-reload
sudo systemctl start redis
- Redis 활성화 하여 Boot 시 시작 등록
sudo systemctl enable redis
sudo systemctl status redis
sudo nano /etc/redis/redis.conf
# bind 127.0.0.1 ::1
bind 0.0.0.0
# protected-mode yes
protected-mode no
sudo systemctl restart redis