This file contains hidden or 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
| root@m-mysql01# mysql -u root -p -e "INSERT INTO mysql.user (Host,User) values ('10.250.1.100','haproxy_check'); FLUSH PRIVILEGES;" | |
| root@m-mysql01# mysql -u root -p -e "GRANT ALL PRIVILEGES ON *.* TO 'mycoolapp'@'10.250.1.100' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES" |
This file contains hidden or 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
| root@mysql-cluster# yum install mysql-client | |
| root@mysql-cluster# mysql -h 10.250.1.101 -u haproxy_root -p -e "SHOW DATABASES" |
This file contains hidden or 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
| root@mysql-cluster# yum install haproxy |
This file contains hidden or 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
| root@mysql-cluster# cat /etc/haproxy/haproxy.cfg | |
| global | |
| log 127.0.0.1 local0 notice | |
| user haproxy | |
| group haproxy | |
| defaults | |
| log global | |
| retries 2 |
This file contains hidden or 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
| root@mysql-cluster# haproxy -D -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg |
This file contains hidden or 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
| root@mysql-cluster# mysql -h 10.250.1.101 -u mycoolapp -p password -e "SHOW DATABASES" |
This file contains hidden or 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
| root@mysql-cluster# mysqlslap --auto-generate-sql --concurrency=50 --number-of-queries=1000 --iterations=10 -umycoolapp -ppassword -h10.250.10.100 | |
| Benchmark | |
| Average number of seconds to run all queries: 3.102 seconds | |
| Minimum number of seconds to run all queries: 2.990 seconds | |
| Maximum number of seconds to run all queries: 3.174 seconds | |
| Number of clients running queries: 50 | |
| Average number of queries per client: 20 |
This file contains hidden or 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
| root@mysql-cluster# mysqlslap --auto-generate-sql --concurrency=50 --number-of-queries=1000 --iterations=10 -umycoolapp -ppassword -h10.250.10.101 | |
| Benchmark | |
| Average number of seconds to run all queries: 3.182 seconds | |
| Minimum number of seconds to run all queries: 3.073 seconds | |
| Maximum number of seconds to run all queries: 3.329 seconds | |
| Number of clients running queries: 50 | |
| Average number of queries per client: 20 |
This file contains hidden or 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
| listen MySQL-Proxy 10.250.1.100:3306 | |
| mode tcp | |
| option mysql-check user haproxy_check | |
| balance roundrobin | |
| server m-mysql01 10.250.1.101:3306 check maxconn 20 | |
| #server m-mysql02 10.250.1.102:3306 check maxconn 20 |
This file contains hidden or 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
| ╭─james@darktech ~ | |
| ╰─$ env X="() { :;} ; echo Vulnerable" /bin/sh -c "echo hello world" | |
| Vulnerable | |
| hello world |
OlderNewer