일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 소프티어
- boj #19237 #어른 상어
- compose
- 경력
- softeer
- 기술면접
- incr
- @P0
- 13908
- 오퍼레터
- 6987
- 연결요소
- 매개변수탐색
- 백트래킹
- 처우산정
- 퇴사통보
- BOJ
- 성적평가
- 처우협의
- msSQL
- OFFSET
- 파라메트릭
- Kafka
- 물채우기
- upper_bound
- dfs
- BFS
- Docker
- 이분탐색
- 백준
- Today
- Total
기술 블로그
docker redis 본문
Copyright (C) Microsoft Corporation. All rights reserved.
새로운 크로스 플랫폼 PowerShell 사용 https://aka.ms/pscore6
PS C:\Users\park7> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ccdc10043dd3 mysql "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
PS C:\Users\park7> docker pull redis
Using default tag: latest
latest: Pulling from library/redis
a803e7c4b030: Pull complete
8009fe658ed7: Pull complete
3033e3de8673: Pull complete
442450dd5ab0: Pull complete
c47c32a5a8bc: Pull complete
8007816b16c2: Pull complete
Digest: sha256:ae51486efeea8a9b3f85542e408f79a5012d5b7fa35ae19733104ecc6992a248
Status: Downloaded newer image for redis:latest
docker.io/library/redis:latest
PS C:\Users\park7> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ccdc10043dd3 mysql "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
PS C:\Users\park7> docker run --name myredis -d -p 6379:6379 redis
972184460c21d52dbc76d5ab7266bc4f27cc2b934230e7740195658358f08354
PS C:\Users\park7> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
972184460c21 redis "docker-entrypoint.s…" 8 seconds ago Up 5 seconds 0.0.0.0:6379->6379/tcp myredis
ccdc10043dd3 mysql "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
PS C:\Users\park7> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
972184460c21 redis "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:6379->6379/tcp myredis
ccdc10043dd3 mysql "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
PS C:\Users\park7> docker exec -it 972184460c21 redis-cli
127.0.0.1:6379> setnx 1 lock
(integer) 1
127.0.0.1:6379> setnx 1 lock
(integer) 0
127.0.0.1:6379> del 1
(integer) 1
127.0.0.1:6379> setnx 1 lock
(integer) 1
127.0.0.1:6379> del 1
(integer) 1
127.0.0.1:6379>
PS C:\Users\park7> docker exec -it 972184460c21 redis-cli
127.0.0.1:6379> setnx 1 lock
(integer) 1
127.0.0.1:6379> setnx 1 lock
(integer) 0
127.0.0.1:6379> del 1
(integer) 1
127.0.0.1:6379> setnx 1 lock
(integer) 1
127.0.0.1:6379> del 1
(integer) 1
127.0.0.1:6379> subscribe ch1
1) "subscribe"
2) "ch1"
3) (integer) 1
1) "message"
2) "ch1"
3) "hello"
밑에는 다른 터미널
PS C:\Users\park7> docker exec -it 972184460c21 redis-cli
127.0.0.1:6379> publish ch1 hello
(integer) 1
127.0.0.1:6379>
'온라인강의 > 동시성이슈' 카테고리의 다른 글
MySql과 Redis (0) | 2023.10.01 |
---|---|
전체 내 소스 (0) | 2023.10.01 |
intellij 프로젝트 JDK 설정 오류 및 JDK 추가 (0) | 2023.10.01 |
작업환경 세팅(feat. 다시 세팅할 때) (0) | 2023.09.30 |