Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
shahidkratin
@shahidkratin
?
Hello,
shahidkratin
@shahidkratin

Following is the Scenario I need to achieve:
A Redis master-slave replication setup with sentinel which will be load balanced by gobetween where gobetween will direct all write hits to the master.

This is possible with HAProxy as it checks which node is master internally.
link-> https://karlstoney.com/2015/07/23/redis-sentinel-behind-haproxy/

Can gobetween Do the same?

Natalio
@NcGatti_twitter
Hi, good morning for everyone. I am testing gobetween as a UDP reverse proxy, for load balancing and failover. The load balancing is working good, but it isn't doing failover. I added a custom healthcheck, I can see that it is marking a backend as failed, but it doesn't re-routing the requests
Can I share with you my config and see what am I missing?
Ronny Trommer
@indigo423

Hello everyone, I try to get a minimal gobetween UDP sample up and running. I get the error message:

udp-lb    | 2020-02-09 19:30:35 [FATAL] (manager): udp protocol requires to specify at least one of (client|backend)_idle_timeout, udp.max_requests, udp.max_responses

I ran out of ideas why this happens. This here is my configuration file and the docker-compose.yml. Any hints would be appreciated.

Nick Doikov
@nickdoikov
try to move defaults to the server section , also you still need
udp.max_requests=
udp.max_responses=
Ronny Trommer
@indigo423

@nickdoikov Got it to work, thanks a lot for your help. My next goal is to test the transparent transport. I moved to the latest docker image cause the docs mention it is available in 0.8.0+. Here is my configuration file. There is a hint in the docs which means:

if true - work in transparent mode, when forwarded udp packets have client source address (requires additional host configuration) (since 0.8.0)

Anyone with some hints where I can read which additional host configurations are required? Thank you in advance

jrAtAustin
@jrAtAustin
When I enable health check I get the following error:
gobetween v0.7.0
2020-02-10 09:55:02 [INFO ] (manager): Initializing...
2020-02-10 09:55:02 [INFO ] (api): Starting up API
2020-02-10 09:55:02 [INFO ] (server): Creating 'sample': 0.0.0.0:3000 weight static none
2020-02-10 09:55:02 [INFO ] (metrics): Metrics disabled
2020-02-10 09:55:02 [INFO ] (scheduler): Starting scheduler sample
2020-02-10 09:55:02 [INFO ] (api): Starting HTTP server :8888
2020-02-10 09:55:02 [FATAL] (manager): No bind specified
Here is my health check configuration:

-------------------- healthchecks -------------------------

#
[servers.default.healthcheck]
kind = "exec"
interval = "2s"
timeout = "1s"
exec_command = "/Users/me/bin/healthcheck.sh"
exec_expected_positive_output = "1"
exec_expected_negative_output = "0"
fails = 2
passes = 2
Here is the script:

!/bin/bash

nc -z $1 $2

if [ $? -eq 0 ]
then
echo -n 1 ;
else
echo -n 0 ;
fi

When I comment out the health check setting go-between works. Any ideas what's wrong?
mw-0
@mw-0
@jrAtAustin pipe nc to null as it doesn't like anything returned from nc
Is there any way to bind to Nic? I have been testing and using a floating vip the service will not start if the ip in my config is not on that host currently. I cannot bind to * as there are other services there
Mark Davidson
@MDavidson01

Hi everyone I just started using Gobetween I have two webservers running on port 91 and 92 on the same server i use roundrobin for the servers so that it will evenly distribute the traffic between the two webservers but i am having an issue. when you login to the site and then try to go to a different page it will sometimes move you to the next server in the list my config file is the following :[servers.website]
protocal = "tcp"
bind = "0.0.0.0:90"
balance = "roundrobin"

maxconnections = 10000
client_idle_timeout = "40m"
backend_idle_timeout = "40m"
backend_connection_timeout = "2m"

[servers.website.discovery]
kind = "static"
static_list = [
"127.0.0.1:91",
"127.0.0.1:92"
]

have i got something wrong
Mark Davidson
@MDavidson01
sorry made a mistake with the copy of the paste the config i am using is

[servers.website]
protocal = "tcp"
bind = "0.0.0.0:90"
balance = "roundrobin"

maxconnections = 10000
client_idle_timeout = "40m"
backend_idle_timeout = "40m"
backend_connection_timeout = "2m"

[servers.website.discovery]
kind = "static"
static_list = [
"127.0.0.1:91 weight=1",
"127.0.0.1:92 weight=1"
]

Yaroslav Pogrebnyak
@yyyar
Hi @MDavidson01 this is how roundrobin works, it selects next backend in a list for each new connection.
If you need to select always certain backend for the client, you can use balance = "iphash" or "iphash1"
Mark Davidson
@MDavidson01
Tried iphash still same issue will try iphash1 tomorrow with users and see if they complain
David W Purser
@dwpurser
I am trying to setup static routes and my connections via HTTPS 443 are working correctly, however for HTTP 80 I am getting "No matching sni [] found" however I know I am matching file below for mpm088.

[servers]

[servers.default]
protocol = "tcp"

bind = "0.0.0.0:3000"

bind = "0.0.0.0:443"

[servers.default.discovery]
kind = "static"
static_list = [
"192.168.198.10:8060 sni=sx10.mydomain.tld",
"192.168.198.11:443 sni=es011.mydomain.tld",
"192.168.198.17:1880 sni=nodered.mydomain.tld",
"192.168.198.17:18084 sni=emqx.mydomain.tld",
"192.168.198.28:443 sni=se8000.mydomain.tld",
"192.168.198.85:443 sni=as085.mydomain.tld",
"192.168.198.86:443 sni=as086.mydomain.tld",
"192.168.198.87:443 sni=as087.mydomain.tld",
"192.168.198.88:443 sni=j8000.mydomain.tld"
]

[servers.default2]
protocol = "tcp"
bind = "0.0.0.0:80"

[servers.default2.discovery]
kind = "static"
static_list = [
"192.168.198.79:80 sni=basrtp.mydomain.tld",
"192.168.198.88:80 sni=mpm088.mydomain.tld"
]

so # is interpreted as bold, funny.
Illarion Kovalchuk
@illarion
Sni depends on "hostname" field, being sent by TLS client, during TLS handshake
cleints connecting to HTTP 80 are obvously not using TLS, so that there's no room for SNI
David W Purser
@dwpurser
so how do you purpose best config to direct traffic to the 2 servers listed above for HTTP?
image.png
Yaroslav Pogrebnyak
@yyyar
@dwpurser Just remove "sni=" tag in discovery that is used in your HTTP proxy server:
[servers.default2]
protocol = "tcp"
bind = "0.0.0.0:80"

[servers.default2.discovery]
kind = "static"
static_list = [
"192.168.198.79:80",
"192.168.198.88:80"
]
David W Purser
@dwpurser
These are completely different devices, how can I configure to proxy the one I want to access? Should I setup Acme Configuration to accept the connection with SNI and proxy appropriate HTTP connection to backend server?
sedov-e
@sedov-e
Hello! Is it possible to send info about request ip address through gobetween to backend service? I saw discussion about implementation adding header in request (X-Forwarded-For). It was in experimental branch. Has it been merged in master?
hazemkmammu
@hazemkmammu
@yyyar What really is the difference between iphash and iphash1? My basic understanding is that iphash tries to route all requests from a specific client IP to the same backend. The docs say iphash1 is "same as iphash but backend removal consistent (clients remain connecting to the same backend, even if some other backends down)". Why should iphash worry about other backends going down, as long as the backend mapped to the client IP is up, it can keep connecting to the same backend, can't it?
pratheek bangera
@pratb_gitlab
Hi, I am new to goBetween. I wanted to check if I can create 2 pools in goBetween. Basically aim is to forward all packets without loadbalancing in one of the pool and for the second pool i would need to loadbalance. Is something like this possible ?
Yaroslav Pogrebnyak
@yyyar
@hazemkmammu it's because current iphash implementations are not really "sticky". I.e it's stateless: it computes hash of client IP address and then selects the corresponding backend each time request comes in. When backend list changes, that selection may fall on different backend. Example: hash(IP) = 5, and there are 3 backends. We route it to 5 % 3 = 2nd backend. If count of backends changes, for example, we now have 4 backends. So now for hash(IP) = 5 we have 5 % 4 = 1, so we route to 1st backend, that is different from previous situation.
"Sticky" iphash still needs to be implemented (yyyar/gobetween#191)
@pratb_gitlab hi, not sure what do you mean under "pool". You can use multiple separate "servers" configurations in gobetween and configure them independently.
hazemkmammu
@hazemkmammu
@yyyar That explains the unexpected behaviour we have been experiencing when the backends go down. Thank you for explaining.
Illarion Kovalchuk
@illarion
@hazemkmammu please see http://gobetween.io/documentation.html#Balancing , description of iphash1 balancing
Target backend will be calculated using hash function of client ip address in a way that if some backend goes down, only clients of the affected backend will be proxied to another backends. When affected backend gets restored, only its clients will be rebalanced back to it.
@hazemkmammu balancing is executed only when new connection is initiated, so that, if tcp connection is established, it will remain on the same backend

Why should iphash worry about other backends going down, as long as the backend mapped to the client IP is up

There's no mapping, that's why ;)

Illarion Kovalchuk
@illarion
it's stateless
pratheek bangera
@pratb_gitlab
@yyyar Thank you. I will try it out. Can we horizontally scale goBetween ?
Shantanu Gadgil
@shantanugadgil
@pratb_gitlab you should be able to launch multiple GB instances which point to the same backends as long as the backends can tolerate this.(adequately stateless backends)
LordBurrito
@LordBurrito

Hi guys, first thanks for your fantastic work, I'm actually using your LB to forward system log to elasticsearch. I've seen there was a question about keeping the source IP.

Sure, right now we have a syslog stream which is forwarded by two nginx nodes to two logstash nodes. If we dont have the nginx option mentioned before, elastic will think that the syslog is commin from the nginx node. By issuing the option above it keeps the source IP when its forwarded and lets elastic find out the real source IP of the syslog

has this been implemented? I couldn't find anything in your documentation. that would be very useful to me.
pratheek bangera
@pratb_gitlab
@shantanugadgil Thank you.
pratheek bangera
@pratb_gitlab
@yyyar for the previous question on pools, I could not proceed with creating a new server configuration as I receive the information only one port. To explain my situation a little better. I receive the traffic on port x and I need to load balance the traffic across device 1 and device 2 and in addition I need to send/ replicate the complete information to device 3 (not load balanced). Is something like this doable ?