Giter Site home page Giter Site logo

docker-compose-redis-sentinel's Introduction

docker-compose-redis-sentinel

docker-compose编排方式安装redis 主从复制与哨兵机制

安装准备:

[root@localhost ]#mkdir -p /usr/local/docker-compose-redis-sentinel

将准备文件全部上传到docker-compose-redis-sentinel目录下

[root@localhost ]#cd /usr/local/docker-compose-redis-sentinel

[root@localhost docker-compose-redis-sentinel]#ll

创建网卡:

[root@localhost docker-compose-redis-sentinel]# docker network create --driver=bridge --subnet=172.168.0.0/16 redis-test

查看网卡:

[root@localhost docker-compose-redis-sentinel]# docker network ls

1.构建镜像

#在dockerfile目录 执行下面代码,注意后面上下文点号,执行创建镜像; 创建完成后可以docker images查看生成的镜像 [root@localhost docker-compose-redis-sentinel]# docker build -t redis .

2.编写docker-compose编排文件docker-compose.yaml

查看构建编排文件的版本

[root@localhost docker-compose-redis-sentinel]# docker-compose version

3.执行编排

[root@localhost docker-compose-redis-sentinel]# docker-compose up -d

4.执行成功后查看容器

[root@localhost docker-compose-redis-sentinel]# docker ps -a

5.编排的启动和关闭都需要在对应的目录下执行

docker-compose start

docker-compose stop

6.查看编排容器

[root@localhost docker-compose-redis-sentinel]# docker-compose ps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.