Redis Master-slave configuration architecture under Kubernetes

Source: Internet
Author: User

The article looked a lot, but all directly from a variety of places directly pull Master,slave mirror, did not explain how these images are built

Well, I'll talk about how these master,slave mirrors are made.

Find a standard Redis image first, such as Docker pull index.tenxcloud.com/docker_library/redis:3.0 (mirror I haven't verified, I'm trying to get the company's standard image)

Then copy the redis.conf from the mirror.

Build a directory master on the machine:

It contains dockerfile,redis-master.conf,run.sh.

Redis-master.conf and copies of the redis.conf consistent, in addition to a modified

protected-mode No

Dockerfile for

From Index.tenxcloud.com/docker_library/redis:3.0COPY redis-master.conf/usr/local/etc/redis/  /"/run.sh" ]

The run.sh script is

redis-server/usr/local/etc/redis/redis.conf--protected-mode No

Build it from below Master

Docker build-t Ericnie/redis-master:3.0  .

Also create a redis-slave directory, similar to master, there are several different, redis-slave.conf configuration, open slaveof

Run.sh for

" s/%master-ip%/${redis_master_ip}/  "/usr/local/etc/redis/"s/%master-port%/{redis_master_port}/ "/usr/ local/etc/redis/Redis.confredis-server/redis-slave/redis.conf--protected-mode No

${REDIS_MASTER_IP} and ${redis_master_port} are brought in with the ENV variable to create the images.

Build slave with the following command

Docker build-t Ericnie/redis-slave:3.0  .

Redis Master-slave configuration architecture under Kubernetes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.