본문 바로가기
Linux

Redis 사용하기

by GoodDev 2017. 6. 19.

1. Redis 설치

#wget http://download.redis.io/releases/redis-6.0.9.tar.gz

# tar xvfz redis-6.0.9.tar.gz

# cd redis-6.0.9

# make -j4 && make install  -j4

 

# cd utils

 

# ./install_server.sh

 

하단의 오류 발생시에는

 

This systems seems to use systemd. Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!

 

> install_server.sh 의 스크립트를 수정한다.

#bail if this system is managed by systemd #_pid_1_exe="$(readlink -f /proc/1/exe)" #if [ "${_pid_1_exe##*/}" = systemd ] #then #       echo "This systems seems to use systemd." #       echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!" #       exit 1 #fi

2. redis 설치 확인 및 환경 설정

# redis-cli

 

redis 127.0.0.1:6379> ping

PONG

redis 127.0.0.1:6379>

 

# vi /etc/redis/6379.conf

requirepass <password>

bind <IP나 DNS 로 변경>

 

3. redis 재시작

#/etc/init.d/redis_6379 restart

-----------------------------------------------------------

# 원격접속 redis-cli -h #{호스트명} -p #{포트번호}

댓글