zoukankan      html  css  js  c++  java
  • 集群容器管理之swarm 服务管理

    服务管理

    # 创建服务
    docker service create --replicas 1 --name hello busybox

    # docker service update --args "ping www.baidu.com" hello

     

    # 显示服务详细信息
    docker service inspect --pretty hello # 易于阅读显示


    docker service inspect hello # json格式返回


    # 扩展服务实例数
    docker service scale hello=3


    # 查看服务任务
    docker service ls

     


    docker service ps hello

    docker service ps -f 'desired-state=running' hello


    # 滚动更新服务
     docker service create --replicas 3 --name redis --update-delay 10s redis:3.0.6

      

     docker service update --image redis:3.0.7 redis

    docker service inspect --pretty redis

    # 创建服务时设定更新策略

     docker service create --name web --replicas 3 --update-delay 10s --update-parallelism 2 --update-failure-action continue nginx:1.12

    # 创建服务时设定回滚策略

    docker service create  --name web --replicas 10  --rollback-parallelism 2  --rollback-monitor 20s  --rollback-max-failure-ratio .2  nginx:1.12

    # 服务更新
    docker service update --image nginx:1.13 web

    # 手动回滚
    docker service update --rollback web

    #删除

  • 相关阅读:
    算法图解
    Cairo graphics tutorial
    远程对象调用
    异步和多线程的关系
    jQuery调用api
    GTK# tutorial
    DLT
    protobuf入门笔记
    PDO讲解
    数据库练习——分页查询
  • 原文地址:https://www.cnblogs.com/peter1007/p/8743097.html
Copyright © 2011-2022 走看看