• haproxy keepalived和nodejsv9的容器镜像所需文件


    配合hub.docker.com

    的dablyo/haproxy-keepalived-nodejsv9:190407 使用的

    [root@haproxy ~]# cat haproxy.cfg
    global
    daemon
    maxconn 256
    pidfile /root/haproxy.pid

    defaults
    mode http
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

    frontend http-in
    bind *:3000
    default_backend servers

    backend servers
    balance roundrobin
    server s0 172.18.0.2:3000 maxconn 32
    server s1 172.18.0.3:3000 maxconn 32

    [root@haproxy ~]# cat sources.list.jessie
    deb http://mirrors.163.com/debian/ jessie main non-free contrib
    deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
    deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
    deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
    deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
    deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
    deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
    deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

    以及

    [root@haproxy ~]# cat create-cotainer.sh
    docker network rm ha-net
    sleep 1
    echo "docker network ha-net has been removed..."
    docker stop hanode0
    docker stop hanode1
    docker rm hanode0
    docker rm hanode1
    echo "docker container hanode0 and hanode1 have been removed..."
    docker network create --subnet 172.18.0.0/16 ha-net
    echo "docker network create --subnet 172.18.0.0/16 ha-net..."
    sleep 3
    docker create -it --ip 172.18.0.2 --name hanode0 --network ha-net
    --restart="always" --privileged="true"
    -e INTERFACE="eth0"
    -e STATE="MASTER"
    -e VIRTUAL_ROUTER_ID="51"
    -e PRIORITY="101"
    -e VIRTUAL_IP="172.18.0.254"
    -e VIRTUAL_MASK="24"
    -v haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
    -v /var/run/docker.sock:/var/run/docker.sock
    -v /root/.docker:/root/.docker
    -v /root/sources.list.jessie:/etc/apt/sources.list dablyo/haproxy-keepalived-nodejsv9:190407
    [/usr/local/sbin/haproxy] [-f, /usr/local/etc/haproxy/haproxy.cfg]
    sleep 3
    docker create -it --ip 172.18.0.3 --name hanode1 --network ha-net
    --restart="always" --privileged="true"
    -e INTERFACE="eth0"
    -e STATE="SLAVE"
    -e VIRTUAL_ROUTER_ID="51"
    -e PRIORITY="101"
    -e VIRTUAL_IP="172.18.0.254"
    -e VIRTUAL_MASK="24"
    -v haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
    -v /var/run/docker.sock:/var/run/docker.sock
    -v /root/.docker:/root/.docker
    -v /root/sources.list.jessie:/etc/apt/sources.list dablyo/haproxy-keepalived-nodejsv9:190407
    [/usr/local/sbin/haproxy] [-f, /usr/local/etc/haproxy/haproxy.cfg]

  • 相关阅读:
    倒计时显示
    Global.asax实现屏蔽ip和图片防盗链
    同一账号不能同时登陆
    javascript中defer的作用
    javascript焦点图
    asp.net自定义分页
    GridVew linkbutton点击时获取点击行label的绑定值
    内存对齐
    深入.NET托管堆(Managed Heap)
    内存对齐1
  • 原文地址:https://www.cnblogs.com/dablyo/p/10668411.html
Copyright © 2020-2023  润新知