OS/Linux

Redis 설치

파란크리스마스 2020. 7. 2. 01:13
728x90

출처

Redis 설치

$ sudo apt-get update

Redis 서비스 실행

$ sudo service redis-server start

Redis 서비스 실행 상태 확인

$ sudo systemctl status redis-server.service 
● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-07-02 01:24:28 KST; 4s ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 3172 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 3183 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
 Main PID: 3184 (redis-server)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/redis-server.service
           └─3184 /usr/bin/redis-server 127.0.0.1:6379
 
 7월 02 01:24:27 bluesanta-ubuntu systemd[1]: Starting Advanced key-value store...
 7월 02 01:24:28 bluesanta-ubuntu systemd[1]: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid (yet?) after start: No such file or directory
 7월 02 01:24:28 bluesanta-ubuntu systemd[1]: Started Advanced key-value store.

redis-cli 명령

$ redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> exit

Redis 로그 확인

$ sudo tail -f /var/log/redis/redis-server.log
3183:C 02 Jul 01:24:28.063 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
3183:C 02 Jul 01:24:28.063 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=3183, just started
3183:C 02 Jul 01:24:28.063 # Configuration loaded
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 3184
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

3184:M 02 Jul 01:24:28.065 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
3184:M 02 Jul 01:24:28.065 # Server initialized
3184:M 02 Jul 01:24:28.065 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
3184:M 02 Jul 01:24:28.065 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
3184:M 02 Jul 01:24:28.066 * DB loaded from disk: 0.000 seconds
3184:M 02 Jul 01:24:28.066 * Ready to accept connections