国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > Redis > 正文

docker安裝redis5.0.3的方法步驟

2024-09-07 00:33:50
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

一、拉取官方5.0.3鏡像

[root@localhost ~]# docker pull redis:5.0.3

下載完成

[root@localhost ~]# docker pull redis:5.0.35.0.3: Pulling from library/redisf7e2b70d04ae: Pull complete 421427137c28: Pull complete 4af7ef63ef0f: Pull complete b858087b3517: Pull complete 2aaf1944f5eb: Pull complete 8270b5c7b90d: Pull complete Digest: sha256:4be7fdb131e76a6c6231e820c60b8b12938cf1ff3d437da4871b9b2440f4e385Status: Downloaded newer image for redis:5.0.3

二、創(chuàng)建掛載目錄

1、創(chuàng)建掛載文件夾

[root@localhost ~]# mkdir -p /root/redis/data /root/redis/conf[root@localhost ~]# cd redis/[root@localhost redis]# lsconf data

2、創(chuàng)建redis.conf

在/root/redis/conf目錄中創(chuàng)建文件 redis.conf

touch redis.conf

顯示目錄

[root@localhost redis]# cd conf/[root@localhost conf]# ls[root@localhost conf]# touch redis.conf[root@localhost conf]# lsredis.conf[root@localhost conf]# 

三、創(chuàng)建redis 容器

docker run -d --name redis -p 6379:6379 -v /root/redis/conf/redis.conf:/redis.conf -v /root/redis/data:/data redis:5.0.3 redis-server --appendonly yes

參數(shù)說(shuō)明:

-d 后臺(tái)運(yùn)行

-p 端口映射到主機(jī)的端口

-v 將主機(jī)目錄掛載到容器的目錄

redis-server --appendonly yes : 在容器執(zhí)行redis-server啟動(dòng)命令,并打開redis持久化配置

1、啟動(dòng)redis

啟動(dòng)中報(bào)錯(cuò)如下:

[root@localhost ~]# docker run -d --name redis -p 6379:6379 -v /root/redis/conf/redis.conf:/redis.conf -v /root/redis/data:/data redis:5.0.3 redis-server --appendonly yes9bc537c19ff0ad76727b5215da8cba4223c5ff97f1d9a53585d573ca71fd8c0cdocker: Error response from daemon: driver failed programming external connectivity on endpoint redis (fa297144f8d0c958288bb35a94ffbec545d348f2ff9f55a5b573f3d9a0354ace): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 6379 -j DNAT --to-destination 172.17.0.3:6379 ! -i docker0: iptables: No chain/target/match by that name. (exit status 1)).

說(shuō)明: docker服務(wù)啟動(dòng)時(shí)定義的自定義鏈DOCKER由于某種原因被清掉
重啟docker服務(wù)及可重新生成自定義鏈DOCKER

解決方案:

第一步、重啟docker;

第二步、啟動(dòng)容器;

systemctl restart dockerdocker start foo

2、容器創(chuàng)建成功,啟動(dòng)redis容器

docker start redis

1、啟動(dòng)失敗問(wèn)題:?jiǎn)?dòng)容器就會(huì)出現(xiàn)iptables: No chain/target/match by that name出錯(cuò)

粗暴解決方案
重啟docker

2、正常啟動(dòng)啟動(dòng)顯示

四、客戶端連接

我用的 RedisDesktopManager

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿坝县| 那曲县| 泗水县| 宝丰县| 长阳| 沂南县| 灵石县| 将乐县| 康乐县| 广昌县| 淮阳县| 三江| 天水市| 宁南县| 乐东| 酒泉市| 长春市| 昆山市| 洞头县| 景东| 瑞丽市| 凭祥市| 荥经县| 禹城市| 普安县| 浦江县| 麦盖提县| 万州区| 霍邱县| 毕节市| 东光县| 武夷山市| 麟游县| 邹城市| 辉县市| 宝清县| 新绛县| 兴山县| 旅游| 西昌市| 无为县|