docker 安装 redis docker search redis docker pull redis docker run --restart=always --log-opt max-size=100m \ --log-opt max-file=2 -p 6379:6379 \ --name myredis \ -v ~/redis/redis.conf:/etc/redis/redis.conf \ -v ~/redis/data:/data \ -d redis redis-server /etc/redis/redis.conf \ --appendonly yes --requirepass 123456 –restart=always 总是开机启动 –log是日志方面的 -p 6379:6379 将6379端口挂载出去 –name 给这个容器取一个名字 -v 数据卷挂载 ~/redis/redis.conf:/etc/redis/redis.conf 这里是将 liunx 路径下的redis.conf 和redis 下的redis.conf挂载在一起。 ~/redis/data:/data 这个同上 -d redis 表示后台启动redis redis-server /etc/redis/redis.conf 以配置文件启动redis,加载容器内的conf文件, 最终找到的是挂载的目录 /etc/redis/redis.conf 也就是liunx下的~/redis/redis.conf –appendonly yes 开启redis 持久化 –requirepass 000415 设置密码 查看当前redis有没有设置密码: config get requirepass
分类 "Docker" 下的文章
ERROR: Attempting to operate on yarn resourcemanager as root
ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
Starting nodemanagers
ERROR: Attempting to operate on yarn nodemanager as root
ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.
ERROR: Attempting to operate on hdfs namenode as root
ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
Starting datanodes
ERROR: Attempting to operate on hdfs datanode as root
ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.