当前位置:网站首页>Ubuntu下Docker安装Redis (快速简便)
Ubuntu下Docker安装Redis (快速简便)
2022-08-08 23:53:00 【全栈小定^.^】
Docker快速安装Redis
1 前置准备
1.1 下载redis安装包
1.2 解压获取配置文件
1.3 修改配置文件
bind 127.0.0.1 #注释掉这部分,这是限制redis只能本地访问
protected-mode no #默认yes,开启保护模式,限制为本地访问
daemonize no #默认就行,改为yes意为以守护进程方式启动,可后台运行,除非kill进程(可选),改为yes会使配置文件方式启动redis失败
requirepass 123456 # 密码123456
2 启动
# 创建redis目录,存放我们的数据及配置文件
mkdir redis
cd redis
# 将第二步修改的的redis.config 复制到这里
# 启动redis
docker run -p 6379:6379 --name redis -v $PWD/redis.conf:/etc/redis/redis.conf -v $PWD/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes
3 效果
边栏推荐
猜你喜欢
随机推荐
[QNX Hypervisor 2.2用户手册]10.12 ser8250vdev ser8250 options
第五章 数据库编程
redis集群redis-trib扩容缩容
HCIP2---静态路由、动态路由
RHCSA--第一天
读书笔记怎么写?
mysql 高级知识【order by 排序优化】
[Deep Learning] TensorFlow Learning Road One: Introduction to TensorFlow and Implementation of Linear Regression and Logistic Regression
BGP实验
跨域请求浏览器无法显示set-cookie,坑了我一晚上
获取一星期前的时间 n-1 为含当天 一周7天 7-1
Get the start time and end time of the current month half a year ago
TCP三次握手、四次断开
05 Spark on 读取内部数据分区存储策略(源码角度分析)
截图:如何截图?(我想截鼠标右键按出来的图?)
pytorch常用代码
BGP总结
51nod1798 打怪兽
了解CI/CD流水线
03 Spark on 读取内部数据分区策略(源码角度分析)