diff --git a/pigx-redis/docker-compose.yml b/pigx-redis/docker-compose.yml new file mode 100644 index 000000000..981155519 --- /dev/null +++ b/pigx-redis/docker-compose.yml @@ -0,0 +1,37 @@ +# 运行:docker-compose up -d +# 运行(推荐):docker-compose up --build +# 查看:docker ps -a +# 集群:docker run --rm -it zvelo/redis-trib create --replicas 1 ip:6061 ip:6062 ip:6063 ip:6064 ip:6065 ip:6066 + +version: '2' +services: + redis-slave1: + build: ./slave1 + ports: + - 6061:6061 + - 16061:16061 + redis-slave2: + build: ./slave2 + ports: + - 6062:6062 + - 16062:16062 + redis-slave3: + build: ./slave3 + ports: + - 6063:6063 + - 16063:16063 + redis-slave4: + build: ./slave4 + ports: + - 6064:6064 + - 16064:16064 + redis-slave5: + build: ./slave5 + ports: + - 6065:6065 + - 16065:16065 + redis-slave6: + build: ./slave6 + ports: + - 6066:6066 + - 16066:16066 \ No newline at end of file diff --git a/pigx-redis/slave1/Dockerfile b/pigx-redis/slave1/Dockerfile new file mode 100644 index 000000000..9070952d6 --- /dev/null +++ b/pigx-redis/slave1/Dockerfile @@ -0,0 +1,15 @@ +FROM redis + +MAINTAINER huangbosbos@gmail.com + +COPY redis.conf /usr/local/etc/redis/redis.conf + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +RUN chmod 777 /usr/local/etc/redis/redis.conf + +EXPOSE 6061 +EXPOSE 16061 + +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] \ No newline at end of file diff --git a/pigx-redis/slave1/redis.conf b/pigx-redis/slave1/redis.conf new file mode 100644 index 000000000..e65769891 --- /dev/null +++ b/pigx-redis/slave1/redis.conf @@ -0,0 +1,16 @@ +# 加上注释# +# bind 127.0.0.1 +# 阿里云CentOS7安装redis后不能远程访问解决方案 +# 修改安装redis服务时的配置文件中把127.0.0.1 改为0.0.0.0,然后重启服务即可 +bind 0.0.0.0 ::1 +# 关闭保护模式 +protected-mode no +# 绑定自定义端口 +port 6061 +# 禁止redis后台运行 +#daemonize yes +pidfile /var/run/redis_6061.pid +# 开启集群 把注释#去掉 +cluster-enabled yes +# 集群的配置 配置文件首次启动自动生成 +cluster-config-file nodes_6061.conf \ No newline at end of file diff --git a/pigx-redis/slave2/Dockerfile b/pigx-redis/slave2/Dockerfile new file mode 100644 index 000000000..2876c8cbc --- /dev/null +++ b/pigx-redis/slave2/Dockerfile @@ -0,0 +1,15 @@ +FROM redis + +MAINTAINER huangbosbos@gmail.com + +COPY redis.conf /usr/local/etc/redis/redis.conf + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +RUN chmod 777 /usr/local/etc/redis/redis.conf + +EXPOSE 6062 +EXPOSE 16062 + +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] \ No newline at end of file diff --git a/pigx-redis/slave2/redis.conf b/pigx-redis/slave2/redis.conf new file mode 100644 index 000000000..4dc1af5aa --- /dev/null +++ b/pigx-redis/slave2/redis.conf @@ -0,0 +1,16 @@ +# 加上注释# +# bind 127.0.0.1 +# 阿里云CentOS7安装redis后不能远程访问解决方案 +# 修改安装redis服务时的配置文件中把127.0.0.1 改为0.0.0.0,然后重启服务即可 +bind 0.0.0.0 ::1 +# 关闭保护模式 +protected-mode no +# 绑定自定义端口 +port 6062 +# 禁止redis后台运行 +#daemonize yes +pidfile /var/run/redis_6062.pid +# 开启集群 把注释#去掉 +cluster-enabled yes +# 集群的配置 配置文件首次启动自动生成 +cluster-config-file nodes_6062.conf \ No newline at end of file diff --git a/pigx-redis/slave3/Dockerfile b/pigx-redis/slave3/Dockerfile new file mode 100644 index 000000000..ff946b2f2 --- /dev/null +++ b/pigx-redis/slave3/Dockerfile @@ -0,0 +1,15 @@ +FROM redis + +MAINTAINER huangbosbos@gmail.com + +COPY redis.conf /usr/local/etc/redis/redis.conf + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +RUN chmod 777 /usr/local/etc/redis/redis.conf + +EXPOSE 6063 +EXPOSE 16063 + +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] \ No newline at end of file diff --git a/pigx-redis/slave3/redis.conf b/pigx-redis/slave3/redis.conf new file mode 100644 index 000000000..c0794ad2b --- /dev/null +++ b/pigx-redis/slave3/redis.conf @@ -0,0 +1,16 @@ +# 加上注释# +# bind 127.0.0.1 +# 阿里云CentOS7安装redis后不能远程访问解决方案 +# 修改安装redis服务时的配置文件中把127.0.0.1 改为0.0.0.0,然后重启服务即可 +bind 0.0.0.0 ::1 +# 关闭保护模式 +protected-mode no +# 绑定自定义端口 +port 6063 +# 禁止redis后台运行 +#daemonize yes +pidfile /var/run/redis_6063.pid +# 开启集群 把注释#去掉 +cluster-enabled yes +# 集群的配置 配置文件首次启动自动生成 +cluster-config-file nodes_6063.conf \ No newline at end of file diff --git a/pigx-redis/slave4/Dockerfile b/pigx-redis/slave4/Dockerfile new file mode 100644 index 000000000..a27766fae --- /dev/null +++ b/pigx-redis/slave4/Dockerfile @@ -0,0 +1,15 @@ +FROM redis + +MAINTAINER huangbosbos@gmail.com + +COPY redis.conf /usr/local/etc/redis/redis.conf + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +RUN chmod 777 /usr/local/etc/redis/redis.conf + +EXPOSE 6064 +EXPOSE 16064 + +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] \ No newline at end of file diff --git a/pigx-redis/slave4/redis.conf b/pigx-redis/slave4/redis.conf new file mode 100644 index 000000000..fe2f654dc --- /dev/null +++ b/pigx-redis/slave4/redis.conf @@ -0,0 +1,16 @@ +# 加上注释# +# bind 127.0.0.1 +# 阿里云CentOS7安装redis后不能远程访问解决方案 +# 修改安装redis服务时的配置文件中把127.0.0.1 改为0.0.0.0,然后重启服务即可 +bind 0.0.0.0 ::1 +# 关闭保护模式 +protected-mode no +# 绑定自定义端口 +port 6064 +# 禁止redis后台运行 +#daemonize yes +pidfile /var/run/redis_6064.pid +# 开启集群 把注释#去掉 +cluster-enabled yes +# 集群的配置 配置文件首次启动自动生成 +cluster-config-file nodes_6064.conf \ No newline at end of file diff --git a/pigx-redis/slave5/Dockerfile b/pigx-redis/slave5/Dockerfile new file mode 100644 index 000000000..1f4622efa --- /dev/null +++ b/pigx-redis/slave5/Dockerfile @@ -0,0 +1,15 @@ +FROM redis + +MAINTAINER huangbosbos@gmail.com + +COPY redis.conf /usr/local/etc/redis/redis.conf + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +RUN chmod 777 /usr/local/etc/redis/redis.conf + +EXPOSE 6065 +EXPOSE 16065 + +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] \ No newline at end of file diff --git a/pigx-redis/slave5/redis.conf b/pigx-redis/slave5/redis.conf new file mode 100644 index 000000000..ad445b625 --- /dev/null +++ b/pigx-redis/slave5/redis.conf @@ -0,0 +1,16 @@ +# 加上注释# +# bind 127.0.0.1 +# 阿里云CentOS7安装redis后不能远程访问解决方案 +# 修改安装redis服务时的配置文件中把127.0.0.1 改为0.0.0.0,然后重启服务即可 +bind 0.0.0.0 ::1 +# 关闭保护模式 +protected-mode no +# 绑定自定义端口 +port 6065 +# 禁止redis后台运行 +#daemonize yes +pidfile /var/run/redis_6065.pid +# 开启集群 把注释#去掉 +cluster-enabled yes +# 集群的配置 配置文件首次启动自动生成 +cluster-config-file nodes_6065.conf \ No newline at end of file diff --git a/pigx-redis/slave6/Dockerfile b/pigx-redis/slave6/Dockerfile new file mode 100644 index 000000000..cff235b10 --- /dev/null +++ b/pigx-redis/slave6/Dockerfile @@ -0,0 +1,15 @@ +FROM redis + +MAINTAINER huangbosbos@gmail.com + +COPY redis.conf /usr/local/etc/redis/redis.conf + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +RUN chmod 777 /usr/local/etc/redis/redis.conf + +EXPOSE 6066 +EXPOSE 16066 + +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] \ No newline at end of file diff --git a/pigx-redis/slave6/redis.conf b/pigx-redis/slave6/redis.conf new file mode 100644 index 000000000..c6834e9e1 --- /dev/null +++ b/pigx-redis/slave6/redis.conf @@ -0,0 +1,16 @@ +# 加上注释# +# bind 127.0.0.1 +# 阿里云CentOS7安装redis后不能远程访问解决方案 +# 修改安装redis服务时的配置文件中把127.0.0.1 改为0.0.0.0,然后重启服务即可 +bind 0.0.0.0 ::1 +# 关闭保护模式 +protected-mode no +# 绑定自定义端口 +port 6066 +# 禁止redis后台运行 +#daemonize yes +pidfile /var/run/redis_6066.pid +# 开启集群 把注释#去掉 +cluster-enabled yes +# 集群的配置 配置文件首次启动自动生成 +cluster-config-file nodes_6066.conf \ No newline at end of file