gobetween


Setp 1 - Download

gobetween

  • https://gobetween.io/


Setp 2 - Install


    curl -s https://api.github.com/repos/yyyar/gobetween/releases | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4 | head -n 1 | wget -i -
    tar -zxvf *.tar.gz
    vi config/gobetween.toml
    gobetween -c config/gobetween.toml


    Linux fromsources
    git clone git@github.com:yyyar/gobetween.git
    make
    sudo -E make install
    vi /etc/gobetween.toml
    gobetween -c /etc/gobetween.toml

    gobetween.toml

    [servers.sample]
    bind = "localhost:3000"
    protocol = "tcp" 
    balance = "roundrobin"
    
    max_connections = 10000
    client_idle_timeout = "10m"
    backend_idle_timeout = "10m"
    backend_connection_timeout = "2s"
    
        [servers.sample.discovery]
        kind = "static"
        static_list = [
          "10.0.0.2:22399 weight=5",
          "10.0.0.3:22499 weight=3",
          "10.0.0.5:32399 weight=1"
        ]
    
        [servers.sample.healthcheck]
        fails = 1                      
        passes = 1
        interval = "2s"   
        timeout="1s"             
        kind = "ping"
        ping_timeout_duration = "500ms"
    

    gobetween.service

    [Unit]
    Description=gobetween Service
    Requires=network.target
    After=network.target
    
    [Service]
    Type=simple
    PIDFile=/var/run/gogetween.pid
    ExecStart=/usr/local/gobetween/gobetween --config /usr/local/gobetween/config/gobetween.toml
    KillMode=process
    
    [Install]
    WantedBy=multi-user.target
    

    /bin/cp -rf ./gobetween.service /etc/systemd/system/
    systemctl daemon-reload
    systemctl enable gobetween.service
    systemctl start gobetween