Sign inSign up

jonhartley/proxysql

By jonhartley

Updated over 7 years ago

My version for Kubenetes ?

Image
0

598

jonhartley/proxysql repository overview

ProxySQL 2

Basic Info
  • This is proxysql2 contaqiner utilizing proxysql-admin for config
ENV Variables
  • CLU_USERNAME=root -- use kube secret this is the clusters root user
  • CLU_PASSWORD=password -- use kube secret this is the clusters root password
  • CLU_HOSTNAME=pxc-0.pxccluster.data -- an active node in the cluster
  • CLU_PORT=3306 -- port that MySQL is running on in the cluster
  • PSQL_USERNAME=admin -- use kube secret
  • PSQL_PASSWORD=admin -- use kube secret
  • PSQL_PORT=3306 -- port for connection to ProxySQL
  • MON_PASSWORD=proxy_mon -- monitor user , proxysql-admin will create this user with USAGE grants
  • MON_PASSWORD=pr0xyM0n -- monitor password , proxysql-admin will create this user with USAGE grants
  • CLU_APP_USERNAME=proxysql_user -- application user , proxysql-admin will create this user with ALL grants
  • CLU_APP_PASSWORD=passw0rd -- application password , proxysql-admin will create this user with ALL grants
  • PSQL_MODE=loadbal -- proxysql mode, options are loadbal, singlewrite
  • PSQL_WRITE_NODE=pxc-0 -- if singlewrite mode, which node to initially use as the write master
  • WRITERS_ARE_READERS=yes
  • HOSTLIST="pxc-0.pxccluster,pxc-1.pxccluster,pxc-2.pxccluster"

Create PXC Cluster

docker network create pxccluster


docker run --net pxccluster \
--name pxc-0 \
--hostname pxc-0 \
-v /tmp/pxc1:/var/lib/mysql \
-e CONFIG="max_allowed_packet=1G,innodb_buffer_pool_size=500M,max_connections=1000,wsrep_slave_threads=4" \
-e MYSQL_ROOT_PASSWORD=password \
-e SSTUSER_PASSWORD=password \
-e CLUSTER_NAME=pxc_cluster \
-e CPU_LIMIT=1 \
-e MEM_LIMIT=2147483648 \
-e AUTOTUNE=bufferpool \
-e SSSVC=pxc-0 \
-e NODE_NAME=pxc-0 \
-d jonhartley/kubernetes-pxc

docker run --net pxccluster \
--name pxc-1 \
--hostname pxc-1 \
-v /tmp/pxc2:/var/lib/mysql \
-e CONFIG="max_allowed_packet=1G,innodb_buffer_pool_size=500M,max_connections=1000,wsrep_slave_threads=4" \
-e MYSQL_ROOT_PASSWORD=password \
-e SSTUSER_PASSWORD=password \
-e CLUSTER_NAME=pxc_cluster \
-e CPU_LIMIT=1 \
-e MEM_LIMIT=2147483648 \
-e AUTOTUNE=bufferpool \
-e SSSVC=pxc-0 \
-e NODE_NAME=pxc-1 \
-d jonhartley/kubernetes-pxc

docker run --net pxccluster \
--name pxc-2 \
--hostname pxc-2 \
-v /tmp/pxc3:/var/lib/mysql \
-e CONFIG="max_allowed_packet=1G,innodb_buffer_pool_size=500M,max_connections=1000,wsrep_slave_threads=4" \
-e MYSQL_ROOT_PASSWORD=password \
-e SSTUSER_PASSWORD=password \
-e CLUSTER_NAME=pxc_cluster \
-e CPU_LIMIT=1 \
-e MEM_LIMIT=2147483648 \
-e AUTOTUNE=bufferpool \
-e SSSVC=pxc-0 \
-e NODE_NAME=pxc3 \
-d jonhartley/kubernetes-pxc

docker run --net pxccluster \
--name proxysql \
--hostname proxysql \
-e CLU_USERNAME=root \
-e CLU_PASSWORD=password \
-e CLU_HOSTNAME=pxc-0 \
-d jonhartley/proxysql

Tag summary

Content type

Image

Digest

Size

148.2 MB

Last updated

over 7 years ago

docker pull jonhartley/proxysql