โ Redis ?
Remote Dictionary Server์ ์ฝ์๋ก์, "ํค-๊ฐ" ๊ตฌ์กฐ์ ๋น์ ํ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๊ณ ๊ด๋ฆฌํ๊ธฐ ์ํ ์คํ ์์ค ๊ธฐ๋ฐ์ ๋น๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ด๋ฆฌ ์์คํ ์ด๋ค.
1๏ธโฃ Docker ๋ฅผ ํ์ฉํ๋ ๋ฐฉ๋ฒ
์์ํ๊ธฐ์ ์์ docker๊ฐ ์ค์น๋์ด ์์ด์ผ ํ๋ค. (์๋ ๋งํฌ๋ก ์ ์ํ์ฌ ์ค์น)
Docker Documentation
docs.docker.com
ํฐ๋ฏธ๋(ํน์ iterm)์์ ์๋ ๋ช ๋ น์ด๋ฅผ ์คํํ๋ค.
docker run -p 6379:6379 redis
์ฑ๊ณต์ ์ผ๋ก ์คํ์ด ๋์์ ๊ฒฝ์ฐ, ๋ค์๊ณผ ๊ฐ์ด ํ์ธํ ์ ์๋ค.
Docker์์ redis Container๊ฐ ์์ฑ๋จ์ ํ์ธํ ์ ์๋ค.
์ ์์ ์ผ๋ก ์ฐ๊ฒฐ๋์๋์ง ํ์ธํ๊ธฐ ์ํด์ vscode์์ ํ์ธํด๋ณด์๋ค.
def check_connection():
r = redis.Redis("localhost")
print(r.ping())
> True
2๏ธโฃ ์์ค ๋ค์ด๋ก๋ ๋ฐ๊ณ ์คํํ๋ ๋ฐฉ๋ฒ
์๋ ๋งํฌ๋ฅผ ํด๋ฆญํ์ฌ ์์ค๋ฅผ ๋ค์ด๋ฐ๋๋ค.
https://download.redis.io/releases/redis-6.2.1.tar.gz
๋ค์ด๋ก๋ ๋ฐ์ ํด๋์ ์ ๊ทผํ์ฌ ์ค์นํ๋ค.
cd redis-6.2.1
make install
๋น๋๊ฐ ์๋ฃ๋๋ฉด, src ๋๋ ํ ๋ฆฌ์ redis ์๋ฒ์ ํด๋ผ์ด์ธํธ๊ฐ ์ ์์ ์ผ๋ก ๋น๋๋์์์ ํ์ธํ ์ ์๋ค.
cd src
./redis-server
๋ ํ๋์ ํฐ๋ฏธ๋ ์ฐฝ์ผ๋ก src ๋๋ ํ ๋ฆฌ ์ ๊ทผํด์ redis ์๋ฒ์ ์ ์์ ์ผ๋ก ์ ์๋จ ํ์ธ
๐ Redis ์๋ฒ ์ค์ง
'๐ฉ๐ปโ๐ป > celery + redis' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Redis and Celery (0) | 2025.02.12 |
---|---|
Celery๋ฅผ ์ด์ฉํ ํฌ๋กค๋ง ์์ (1) | 2025.02.05 |
[Redis] Redis์ ๋ํ ๊ฐ๋จํ ์ ๋ฆฌ (0) | 2023.12.04 |
[Flower] Monitoring Celery Tasks using Flower (1) | 2022.06.20 |
[Celery] Celery with Redis (python) : ๋น๋๊ธฐ ์์ queue (0) | 2022.06.06 |