Redis

์ธ๋ฉ”๋ชจ๋ฆฌ ๊ธฐ๋ฐ˜์˜ ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค

์„ค์น˜ํ•˜๊ธฐ

1. ์˜์กด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜

$ sudo apt-get update
$ sudo apt-get install build-essential tcl

ํ•„์ˆ˜ ํŒจํ‚ค์ง€

  • build-essential
    • C, C++ ์ปดํŒŒ์ผ ํ™˜๊ฒฝ์„ ๊ตฌ์„ฑ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•œ๋‹ค.
    • gcc, make ๋ฅผ ํ•œ๋ฒˆ์— ์„ค์น˜ํ•œ๋‹ค.
  • tcl
    • Tool Command Language
    • ์„ค์น˜ํ•œ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ํ™•์žฅํ•˜๋Š” ๊ฒƒ์„ ๋•๋Š” ํ”„๋กœ๊ทธ๋žจ ์–ธ์–ด

2. ์†Œ์Šค ๋‹ค์šด๋กœ๋“œ ๋ฐ ์••์ถ• ํ•ด์ œ

$ mkdir /tmp/src
$ cd /tmp/src
$ curl -O http://download.redis.io/redis-stable.tar.gz
$ tar xvfz redis-stable.tar.gz
$ cd redsi-stable

3. ์ปดํŒŒ์ผ

# ๋นŒ๋“œ
$ make

# ์ƒ๋žต ๊ฐ€๋Šฅ
$ make test

# ๋ช…๋ น์–ด ์„ค์น˜
$ make install

4. ์‹คํ–‰

systemctl ๋ช…๋ น์–ด

$ sudo systemctl start redis
$ sudo systemctl status redis

systemctl ์•ˆ๋  ๋•Œ

# ์„œ๋ฒ„๊ธฐ๋™
$ redis-server

# Redis ์ ‘์† (์ƒˆ ํ„ฐ๋ฏธ๋„๋กœ)
$ redis-cli

์ ‘์† ํด๋ผ์ด์–ธํŠธ ์ด์šฉ

์ ‘์† ํด๋ผ์ด์–ธํŠธ ์‚ฌ์šฉ์‹œ ์™ธ๋ถ€์—์„œ ์ ‘์† ๋ถˆ๊ฐ€ ํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ protected-mode ๋ฅผ ํ•ด์ œํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋„๋ก ํ•œ๋‹ค.

$ redis-cli

127.0.0.1:6379> config set protected-mode no
OK

Issue

  • ์„ค์น˜ ์ดํ›„์— redis ์„œ๋ฒ„๊ฐ€ ๊ธฐ๋™์ด ๋ถˆ๊ฐ€ํ•จ
  • ํ•ด๋‹น ์†Œ์ŠคํŒŒ์ผ ๊ฒฝ๋กœ๋กœ redis-server.sh ๋กœ ๊ธฐ๋™
  • ์ดํ›„ redis-cli ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•จ

์ถ”ํ›„ ์„œ๋น„์Šค๋กœ ๋“ฑ๋กํ•˜์—ฌ ๋ฐ๋ชฌ์œผ๋กœ ๊ธฐ๋™ ๊ฐ€๋Šฅํ•˜๊ฒŒ ์„ค์ • ํ•ด์•ผ ํ•จ