mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 21:17:52 +00:00
add application_name to pgbouncer connectio string
This commit is contained in:
parent
e23d95bf03
commit
0da2efa633
@ -1349,7 +1349,10 @@ PGconn *PostgreSQL::getPgConn(OverrideMode m) {
|
|||||||
char *connStr = getenv("PGBOUNCER_CONNSTR");
|
char *connStr = getenv("PGBOUNCER_CONNSTR");
|
||||||
if (connStr != NULL) {
|
if (connStr != NULL) {
|
||||||
fprintf(stderr, "PGBouncer Override\n");
|
fprintf(stderr, "PGBouncer Override\n");
|
||||||
return PQconnectdb(connStr);
|
std::string conn(connStr);
|
||||||
|
conn += " application_name=controller-";
|
||||||
|
conn += _myAddressStr.c_str();
|
||||||
|
return PQconnectdb(conn.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,4 +5,5 @@ CONTROLLERS=`kubectl get pods -o=name | grep controller | sed "s/^.\{4\}//"`
|
|||||||
for c in ${CONTROLLERS[@]}
|
for c in ${CONTROLLERS[@]}
|
||||||
do
|
do
|
||||||
kubectl delete pod ${c}
|
kubectl delete pod ${c}
|
||||||
|
sleep 30
|
||||||
done
|
done
|
||||||
|
@ -12,6 +12,10 @@ if [ -z "$ZT_DB_PORT" ]; then
|
|||||||
echo '*** FAILED: ZT_DB_PORT environment variable not defined'
|
echo '*** FAILED: ZT_DB_PORT environment variable not defined'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$ZT_DB_NAME" ]; then
|
||||||
|
echo '*** FAILED: ZT_DB_NAME environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [ -z "$ZT_DB_USER" ]; then
|
if [ -z "$ZT_DB_USER" ]; then
|
||||||
echo '*** FAILED: ZT_DB_USER environment variable not defined'
|
echo '*** FAILED: ZT_DB_USER environment variable not defined'
|
||||||
exit 1
|
exit 1
|
||||||
@ -38,7 +42,7 @@ echo "{
|
|||||||
\"inot\",
|
\"inot\",
|
||||||
\"nat64\"
|
\"nat64\"
|
||||||
],
|
],
|
||||||
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=ztc user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} sslmode=require sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\"
|
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=${ZT_DB_NAME} user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
" > /var/lib/zerotier-one/local.conf
|
" > /var/lib/zerotier-one/local.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user