BLOG ESPERANCA

ubuntu 에서 redis 설치하기 본문

OS/Linux

ubuntu 에서 redis 설치하기

yobuce 2016. 12. 30. 10:47

이걸 보고 그대로 따라하면서 했지만, 리눅스 초짜라서 중간중간에 막히는 부분이 있더라구요. 그점을 추가하면서 썰을 풀어보겠습니다.


일단 첫번째로 redis 란?

Redis is a flexible, open-source, key value data store. Following in the footsteps of other NoSQL databases, such as Cassandra, CouchDB, and MongoDB, Redis allows the user to store vast amounts of data without the limits of a relational database. Additionally, it has also been compared to memcache and can be used, with its basic elements as a cache with persistence.
라고 합니다.

- 음.. 그렇군요. 해석은 각자 알아서 ㅋㅋ


인스톨하기전 몇가지 설치를 해줍니다.

1. apt-get 패키지 업데이트

$ sudo apt-get update

2. redis 를 인스톨 하기전 필요한 필수 빌드 컴파일러를 인스톨

$ sudo apt-get install build-essential

3. 이건 왜 하는지 모르겠음.

$ sudo apt-get install tcl8.5


이제 Redis 를 인스톨 해봅시다

1. http://redis.io/download 가서 최신버전을 확인해서 링크를 확인합니다. 현재 최신버전은 http://download.redis.io/releases/redis-2.8.3.tar.gz 네요

$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz

2. 압축을 풀어주고 순서대로 입력합니다.

$ tar -xvzf redis-2.8.3.tar.gz && cd redis-2.8.3

$ sudo make

$ sudo make test

$ sudo cp ./src/redis-server /usr/local/bin/

$ sudo cp ./src/redis-cli/usr/local/bin/

3. redis 서버 세팅을 간편하게 할수 있도록 도와줌

$ cd utils

$ sudo sh install_server.sh

- 포트를 선택하라고 나오는데 기본이 6379임. 나중에 새로운 인스턴스를 추가할때는 다른포트를 입력하면됨 ( ex : 6380, 6381 )

- 엔터를 입력하면 자동으로 설정파일이 생성되서 아주 편리합니다.

4. 설정이 완료되면 자동으로 redis 가 실행됩니다.

1) 서버정지

$ redis-cli -p 6379 shutdown

2) 서버시작 

$ sudo redis-server /etc/redis/6379.conf