Redis 기동 및 종료

2023. 6. 8. 10:34· DataBase/Redis
목차
  1. Redis 기동
  2. Redis 기동 확인
  3. Redis CLI 접속 확인
  4. Redis 종료
  5. Redis Service 등록
  6. Ubuntu
  7. Linux
  8.  
728x90

redis logo

Redis 기동

$ redis-server &

# 정상 기동시 아래와 같은 로그가 확인 됨
23065:M 08 Jun 2023 00:54:10.068 * monotonic clock: POSIX clock_gettime
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 7.0.11 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 23065
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           https://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

23065:M 08 Jun 2023 00:54:10.070 # Server initialized

Redis 기동 확인

ps -ef | grep redis
root       23065     910  0 00:54 pts/0    00:00:00 redis-server *:6379

Redis CLI 접속 확인

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

Redis 종료

$ redis-cli shutdown
23065:M 08 Jun 2023 00:58:42.755 # User requested shutdown...
23065:M 08 Jun 2023 00:58:42.755 * Saving the final RDB snapshot before exiting.
23065:M 08 Jun 2023 00:58:42.756 * DB saved on disk
23065:M 08 Jun 2023 00:58:42.756 # Redis is now ready to exit, bye bye...
[1]+  Done                    redis-server

Redis Service 등록

Ubuntu

  • redis.service 생성
$ cd /etc/systemd/system
$ vi redis.service

# redis.service 내용
[Unit]
Description=redis
After=network.target syslog.target

[Service]
User=root
Group=root
ExecStart=/root/redis-7.0.11/bin/redis-server
ExecStop=/root/redis-7.0.11/bin/redis-cli shutdown
RestartSec=10
Restart=on-failure

[Install]
WantedBy=multi-user.target
  • 서비스 등록
$ systemctl daemon-reload
$ systemctl enable redis.service
  • 서비스 기동 및 종료
# 기동
$ systemctl start redis.service

# 종료
$ systemctl stop reids.service
  • 서비스 해제
$ systemctl disable redis.service

Linux

  • Root에서 작업 진행
$ cd /usr/lib/system/system/
$ vi redis.service

# redis.service 내용
[Unit]
Description=redis
After=network.target syslog.target

[Service]
User=root
Group=root
ExecStart=/root/redis-7.0.11/bin/redis-server
ExecStop=/root/redis-7.0.11/bin/redis-cli shutdown
RestartSec=10
Restart=on-failure

[Install]
WantedBy=multi-user.target
  • 서비스 등록
$ systemctl daemon-reload
$ systemctl enable redis.service
  • 서비스 기동 및 종료
# 기동
$ systemctl start redis.service

# 종료
$ systemctl stop reids.service
  • 서비스 해제
$ systemctl disable redis.service

 

728x90
저작자표시 비영리 변경금지 (새창열림)

'DataBase > Redis' 카테고리의 다른 글

Redis 설정(GENERAL)  (0) 2023.07.12
Redis 설정(NetWork)  (0) 2023.07.12
Benchmark  (0) 2023.07.10
Redis 클러스터  (0) 2023.07.10
Redis 설치  (0) 2023.06.08
  1. Redis 기동
  2. Redis 기동 확인
  3. Redis CLI 접속 확인
  4. Redis 종료
  5. Redis Service 등록
  6. Ubuntu
  7. Linux
  8.  
'DataBase/Redis' 카테고리의 다른 글
  • Redis 설정(NetWork)
  • Benchmark
  • Redis 클러스터
  • Redis 설치
JOTAN
JOTAN
기술 블로그
조탄 기술블로그기술 블로그
JOTAN
조탄 기술블로그
JOTAN
전체
오늘
어제
  • 목 록
    • Security
    • WEB
      • WebtoB
      • Apache
      • Nginx
    • WAS
      • Tomcat
      • JEUS
      • Wildfly
    • Observability
      • Fluentd
    • CI CD
    • DataBase
      • Redis
      • PostgreSQL
      • Victoria Metrics
    • Container Registry
      • Harbor
    • Docker
    • Kubernetes
    • Message Queue
      • Kafka
    • 개발
      • Spring Boot
      • Java
      • Shell Script
    • 기본지식
    • OS
      • Debian
      • Red Hat

블로그 메뉴

  • 홈

공지사항

  • 조'S IT 영역

인기 글

태그

  • 인증서
  • 쿠버네티스 설치
  • Redis Cache
  • nginx
  • Apachje
  • Redis 기능 검증
  • KAFKA
  • 디렉터리 권한 변경 후 Apache 동작
  • 쿠버네티스
  • apache
  • 레디스 설정
  • tomcat
  • 설치
  • Redis TEST
  • harbor
  • Kubernetes
  • Jboss
  • kubernetes install
  • redis 설정
  • webtob
  • redis
  • fluentd
  • wildfly
  • 로그 디렉터리 권한 변경
  • PostgreSQL
  • SSL
  • Datasource 모니터링
  • wildfly14
  • WAS 연동
  • 레디스

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.2
JOTAN
Redis 기동 및 종료
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.