[Ubuntu] redis 설치

패키지로 설치

sudo add-apt-repository -y ppa:rwky/redis
sudo apt-get update

add-apt-repositoy가 안되면 이거 설치 후 재실행

sudo apt-get install python-software-properties

 

레디스 서버 설치

sudo apt-get install redis-server

설정파일

/etc/redis/redis.conf

소스 설치

다운로드
wget http://download.redis.io/releases/redis-3.0.6.tar.gz
압축해제
tar zxvf redis-3.0.6.tar.gz
이동
cd redis-3.0.6

빌드
make
설치 테스트
make test
설치
make install

설정 도움 스크립트

[redis dir]/utils/install_server.sh

 

설정파일

[redis dir]/redis.conf

 

 

실행모습

127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set mykey somevalue1
OK
127.0.0.1:6379> get mykey
"somevalue1"
127.0.0.1:6379> get mykey
"somevalue1"
127.0.0.1:6379> set mykey newval nx
(nil)
127.0.0.1:6379> set mykey newval nx
(nil)
127.0.0.1:6379> get mykey
"somevalue1"
127.0.0.1:6379> set mykey newval
OK
127.0.0.1:6379> get mykey
"newval"
127.0.0.1:6379> set counter 100
OK
127.0.0.1:6379> get counter
"100"
127.0.0.1:6379> set counter1 100
OK
127.0.0.1:6379> get counter1
"100"
127.0.0.1:6379> incr counter1
(integer) 101
127.0.0.1:6379> get counter1
"101"
127.0.0.1:6379> incrby counter1 50
(integer) 151
127.0.0.1:6379> get counter
"100"
127.0.0.1:6379> get counter1
"151"

 

Leave a Reply

Your email address will not be published.

 characters available