본문 바로가기
Language/python

[Python] redis 설치 (리눅스, 윈도우 환경에서)

by 흐암졸령 2021. 7. 17.
반응형

Redis

 redis는 데이터베이스, 캐시, 메세지 브로커 등의 용도로 사용되는 오픈소스 데이터 저장 매체라고 한다. 나는 heroku에서 요청시간이 넘어가도 요청 데이터를 받을 수 있도록 넘기는 용도로 사용했었다. python의 rq, redis 모듈을 사용했었는데 사용 방법은 다음 포스팅에 쓰는 것으로 하고 이번 포스팅에서는 다운로드 하는 방법만 포스팅을 할 것이다.

 

1. Linux 환경에서 설치

 

Redis Quick Start – Redis

*Redis Quick Start This is a quick start document that targets people without prior experience with Redis. Reading this document will help you: Download and compile Redis to start hacking. Use redis-cli to access the server. Use Redis from your application

redis.io

공식 가이드를 보면서 설치하면 된다. 아래의 명령어를 통해서 설치하도록 하자.

$ wget http://download.redis.io/redis-stable.tar.gz 
$ tar xvzf redis-stable.tar.gz 
$ cd redis-stable 
$ make

 

make를 통한 컴파일이 통하면 make test 명령어를 통하여서 잘 되었는지 확인할 수 있다. 이제 아래 명령어를 통해서 redis를 설치하자.

$sudo make install

 

2. Windows 환경에서 설치

 redis가 공식적으로 windows를 지원하지는 않지만 윈도우 64bits에서 사용할 수 있도록 작업을 한 사람이 있다. 이를 다운받기 위해서는 아래의 사이트에서 최신버전을 받으면 된다.

 

Releases · microsoftarchive/redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes - microsoftarchive/redis

github.com

다운을 받고 압축을 풀면 아래와 같은 폴더가 만들어진다.

여기서 redis-server.exe를 실행하면 기본설정으로 127.0.0.1(localhost)의 6379포트에서 실행이 된다.

redis가 잘 작동하는지 확인하기 위해서 redis-cli.exe를 실행하자. 여기서 ping을 입력했을 때 PONG이라는 응답이 나온다면 정상적으로 작동하고 있는 것이다.

반응형

댓글