Tag Info

New answers tagged

0

Thousands should be fine, the total number of health checks on backends may become an issue but ports are not. For a definitive answer you might want to try the HAProxy mailing list.


0

The easiest way is to use two separate IP addresses. Bind one haproxy frontend to each IP address, but use opposite backends as the fallback/backup. i.e. user comes to static.mydomain.com and as long as that cluster is up and running then great. If the app redirects them to dynamic.mydomain.com then great move to the other cluster... or if all the backend ...


0

I'm not sure that I would call DRBD easy, awesome maybe but not easy. As suggested by Jeroen: Round robin DNS or HAProxy can be used to route the traffic to both nodes, but yes your actual problem is that your database is only in one place. So hitting both servers may not be what you want. DRBD would ensure storage is replicated between the servers (solving ...


1

There are multiple solutions for this. The easiest setup is probably this: Synchronize website data between the servers with DRBD Run a MySQL master-slave set-up between the 2 servers. This will mean all database connections will go to one server. If that one fails, you have to switch to the slave (and promote it to master). You can automate this. ...


1

The use of & ~ was deprecated in v7 of rsyslogd, and you're encouraged to use & stop instead. You can read more about it in this section of the v7compatibility page. omruleset and discard (~) action are deprecated Both continue to work, but have been replaced by better alternatives. The discard action (tilde character) has been ...


0

According to the HAProxy manual section on reqirep the search regular expression must match the entire HTTP request line. Neither of the regular expressions you quoted will do that. For details see the HAProxy manual section about the request line which describes its format and should make it clear what you need to match.


1

You can use tcp-check. In a backend section, add something like that : option tcp-check tcp-check connect tcp-check send GET\ /\mainApp\/check HTTP/1.0\r\n tcp-check send Host:\ haproxy.1wt.eu\r\n tcp-check send \r\n tcp-check expect rstring (2..|3..) tcp-check connect tcp-check send GET\ /\microservice1\/check HTTP/1.0\r\n tcp-check send Host:\ ...


0

Well for starters, according to the HAProxy docs option redispatch only works for HTTP proxies: In HTTP mode, if a server designated by a cookie is down, clients may definitely stick to it because they cannot flush the cookie, so they will not be able to access the service anymore. Specifying "option redispatch" will allow the proxy to break ...


1

HAproxy doesn't have built-in functionality for complex health checks like this. That said, what you can do is write a quick and dirty page on the backends (or on the LB if it's easier/better), which performs GET requests on all the microservices and returns an given status code or string for a given result; 200, and 'OK' if they're all fine, 503 and ...


2

The biggest use case for using sticky connections is if your backend servers don't share state information with each other. So a use case might be if the app server writes session data to local disk and not like a database like memcache. That way Another use case would be like you had a site that allowed image uploads but the processing took place on the ...


-1

If I remember correctly, this setting is meant to be use when you want a connection to be load balanced between nodes but you want the connection to stay on the node it goes to for a timeframe you configure.So if I ask google.com and haproxy send me to web25.google.local than I will always be redirect to this server until the timeframe ...


1

As your error message shows, the mysql command is trying to connect via a UNIX socket, not a TCP socket, and consequently ignores the port number. This is what mysql does if you give localhost as the host argument. Try using -h 127.0.0.1 instead.


0

The MySQL client isn't trying to connect via the IP of the system, but rather with the socket file, probably defined in your my.cnf. Since the service isn't running locally, it's not going to work. Try using using the IP when connecting: mysql -h10.181.102.249 -uuser -P 3307 -p -e "show variables like 'server_id'"; or mysql -h10.181.102.249 -uuser -p -e ...


0

You'd probably need to properly escape the string used for the check. You've got option httpchk POST / HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: 53\r\n\r\n{"jsonrpc":"2.0", "method":"xxx", "params":[],"id":1} While I think this might work better option httpchk POST / HTTP/1.1\r\nContent-Type:\ application/json\r\nContent-Length:\ ...


0

Run haproxy -vv and look and look for OPTIONS = USE_LINUX_TPROXY=1 The packaged haproxy for ubuntu 14.04 is NOT built with TPROXY


0

If Varnish is between HAproxy and Apache, you can just have Varnish do the load-balancing, though it's not nearly as robust as the options provided by HAproxy. What might be better would be to have HAproxy send static content to Varnish and the rest directly to the backend servers. Haproxy.com has a very good article on how to do it here. If you really ...


1

If all you want to know is which node is the active one, then look at using the stats show-node directive. Add it to your stats section and you're good to go.


1

The problem lies in a configuration mis-match between HAProxy and Apache. You've told HAProxy to send the client's real IP in a header called X-Real-IP: option forwardfor header X-Real-IP In Apache, you're looking for a header called X-Forwarded-For: $_SERVER['HTTP_X_FORWARDED_FOR'] returns nothing LogFormat "%{X-Forwarded-For} ... You have two ...


1

You seem to have a $ character at the end of your cipher list. Removing it and the last colon should allow it to work. ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:$ Becomes ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES


0

It looks like the problem is resolved. Both VMs had idendical MAC-Adresses for there network interfaces. Changed that, rebooted, works.


0

According to the HAProxy manual, you can use the source keyword to force a backend or listen block to use a particular IP when connecting to servers. Your listen block would then look like: listen mysql-cluster bind 10.0.0.10:3306 mode tcp option mysql-check user haproxy_check balance roundrobin source 10.0.0.10 server db1 10.0.0.120:3307 check ...


0

I have rolled out a hybrid IPVS/HAProxy setup. HAProxy was used to do some fairly heavy L7 decision-making, which made it necessary to scale it out at relatively low traffic volumes. Putting IPVS in front gave the ability to do scale-out of the HAProxy nodes, as well as remove the need to manage failover at that layer. It worked fine, for the specific ...


0

You need something like... balance roundrobin cookie SESSIONID prefix indirect nocache server sso01 MainServer.net check cookie sso01 server sso02 BackupServer.net check cookie sso02 backup (Change SESSIONID to match the name of your session cookie) In your example your servers both have the same name.


-1

You need to tell HAproxy that the backend server is using SSL: server myserver-https x.x.x.x:443 ssl check verify none The 'verify none' part tells haproxy not to verify the certificate chain. I've included it, but it may not be necessary. You shouldn't need any of the header lines you indicated unless you want them.


0

Try using: env(variablename). However, this option seems to only exist in 1.5+. http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.2-env


0

It's a limitation in syslog. You'll notice that the machine name is 31 characters long; that, plus a trailing \0, gives you a nice round power of two.


0

This question is old, but in case someone else runs into this problem: Your problem comes from the fact that tcp-request content runs before HAProxy has had time to receive/read any layer 7 data. How to fix this? Easy: add a tcp-request inspect-delay: listen http 0.0.0.0:80 tcp-request inspect delay 15s acl abuser hdr_sub(user-agent) -f ...


0

You have probably problem with persistent Zabbix DB connections. Tune also your TCP stack - see hints for persistent connections http://www.slideshare.net/Severalnines/haproxy-mysql-slides


0

Problem solved by adding redirect in frontend section. frontend proxy bind 192.168.2.1:443 ssl crt /etc/ssl/certs/certificate.pem acl path_root path / redirect location https://www.example.com/webapp/ if path_root default_backend jboss


0

Let's just stick to the documentation and take notes: The most common reason for the MySQL server has gone away error is that the server timed out and closed the connection. Connection is closed if mysqld receives larger or out-of-order packet. You might want to twick max_allowed_packet variable. Set it some what larger than what it is. Is your ...



Top 50 recent answers are included