-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-monitoring
- Loading branch information
Showing
530 changed files
with
17,317 additions
and
8,739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module linters | ||
|
||
go 1.13 | ||
go 1.23.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
log() { | ||
local message="$1" | ||
local date=$(/usr/bin/date +"%d/%b/%Y:%H:%M:%S.%3N") | ||
|
||
echo "{\"time\":\"${date}\", \"message\": \"${message}\"}" | ||
} | ||
|
||
if [ "$1" = 'haproxy' ]; then | ||
if [ ! -f '/etc/haproxy/pxc/haproxy.cfg' ]; then | ||
log /opt/percona/haproxy.cfg /etc/haproxy/pxc | ||
cp /opt/percona/haproxy.cfg /etc/haproxy/pxc | ||
fi | ||
|
||
custom_conf='/etc/haproxy-custom/haproxy-global.cfg' | ||
if [ -f "$custom_conf" ]; then | ||
log "haproxy -c -f $custom_conf -f /etc/haproxy/pxc/haproxy.cfg" | ||
haproxy -c -f $custom_conf -f /etc/haproxy/pxc/haproxy.cfg || EC=$? | ||
if [ -n "$EC" ]; then | ||
log "The custom config $custom_conf is not valid and will be ignored." | ||
fi | ||
fi | ||
|
||
haproxy_opt='-W -db ' | ||
if [ -f "$custom_conf" -a -z "$EC" ]; then | ||
haproxy_opt+="-f $custom_conf " | ||
else | ||
haproxy_opt+='-f /opt/percona/haproxy-global.cfg ' | ||
fi | ||
|
||
haproxy_opt+='-f /etc/haproxy/pxc/haproxy.cfg -p /etc/haproxy/pxc/haproxy.pid -S /etc/haproxy/pxc/haproxy-main.sock ' | ||
fi | ||
|
||
log 'test -e /opt/percona/hookscript/hook.sh && source /opt/percona/hookscript/hook.sh' | ||
test -e /opt/percona/hookscript/hook.sh && source /opt/percona/hookscript/hook.sh | ||
|
||
log "$@ $haproxy_opt" | ||
exec "$@" $haproxy_opt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
global | ||
log stdout format raw local0 | ||
maxconn 2048 | ||
external-check | ||
insecure-fork-wanted | ||
hard-stop-after 10s | ||
stats socket /etc/haproxy/pxc/haproxy.sock mode 600 expose-fd listeners level admin | ||
|
||
defaults | ||
no option dontlognull | ||
log-format '{"time":"%t", "client_ip": "%ci", "client_port":"%cp", "backend_source_ip": "%bi", "backend_source_port": "%bp", "frontend_name": "%ft", "backend_name": "%b", "server_name":"%s", "tw": "%Tw", "tc": "%Tc", "Tt": "%Tt", "bytes_read": "%B", "termination_state": "%ts", "actconn": "%ac", "feconn" :"%fc", "beconn": "%bc", "srv_conn": "%sc", "retries": "%rc", "srv_queue": "%sq", "backend_queue": "%bq" }' | ||
default-server init-addr last,libc,none | ||
log global | ||
mode tcp | ||
retries 10 | ||
timeout client 28800s | ||
timeout connect 100500 | ||
timeout server 28800s | ||
|
||
resolvers kubernetes | ||
parse-resolv-conf | ||
|
||
frontend galera-in | ||
bind *:3309 accept-proxy | ||
bind *:3306 | ||
mode tcp | ||
option clitcpka | ||
default_backend galera-nodes | ||
|
||
frontend galera-admin-in | ||
bind *:33062 | ||
mode tcp | ||
option clitcpka | ||
default_backend galera-admin-nodes | ||
|
||
frontend galera-replica-in | ||
bind *:3307 | ||
mode tcp | ||
option clitcpka | ||
default_backend galera-replica-nodes | ||
|
||
frontend galera-mysqlx-in | ||
bind *:33060 | ||
mode tcp | ||
option clitcpka | ||
default_backend galera-mysqlx-nodes | ||
|
||
frontend stats | ||
bind *:8404 | ||
mode http | ||
http-request use-service prometheus-exporter if { path /metrics } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o xtrace | ||
|
||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy-entrypoint.sh /opt/percona/haproxy-entrypoint.sh | ||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy_check_pxc.sh /opt/percona/haproxy_check_pxc.sh | ||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy_add_pxc_nodes.sh /opt/percona/haproxy_add_pxc_nodes.sh | ||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy_readiness_check.sh /opt/percona/haproxy_readiness_check.sh | ||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy_liveness_check.sh /opt/percona/haproxy_liveness_check.sh | ||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy.cfg /opt/percona/haproxy.cfg | ||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /haproxy-global.cfg /opt/percona/haproxy-global.cfg | ||
|
||
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D /peer-list /opt/percona/peer-list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
backend galera-nodes | ||
mode tcp | ||
option srvtcpka | ||
balance roundrobin | ||
option external-check | ||
external-check command /opt/percona/haproxy_check_pxc.sh | ||
|
||
backend galera-admin-nodes | ||
mode tcp | ||
option srvtcpka | ||
balance roundrobin | ||
option external-check | ||
external-check command /opt/percona/haproxy_check_pxc.sh | ||
|
||
backend galera-replica-nodes | ||
mode tcp | ||
option srvtcpka | ||
balance roundrobin | ||
option external-check | ||
external-check command /opt/percona/haproxy_check_pxc.sh | ||
|
||
backend galera-mysqlx-nodes | ||
mode tcp | ||
option srvtcpka | ||
balance roundrobin | ||
option external-check | ||
external-check command /opt/percona/haproxy_check_pxc.sh |
Oops, something went wrong.