...
1# ProxySQL in Boulder
2
3In an effort to keep Boulder's development environment reasonably close to
4production we use ProxySQL in our Docker stack to proxy connections to our
5MariaDB database.
6
7## Ports
8
9ProxySQL listens on the following ports:
10 - `6033` Proxy MySQL Interface
11 - `6032` Admin MySQL Interface
12 - `6080` Admin Web Interface
13
14## Accessing the Admin MySQL Interface
15
16```bash
17mysql -uradmin -pradmin -h 127.0.0.1 --port 6032
18```
19
20### MacOS
21
22You will need to bind the port in `docker-compose.yml`, like so:
23
24```yaml
25 bproxysql:
26 ports:
27 - 6032:6032
28```
29
30## Accessing the Admin Web Interface
31
32You can access the ProxySQL web UI at https://127.0.0.1:6080. The default
33username/ password are `stats`/ `stats`.
34
35### MacOS
36
37You will need to bind the port in `docker-compose.yml`, like so:
38
39```yaml
40 bproxysql:
41 ports:
42 - 6080:6080
43```
44
45## Sending queries to a file
46
47To log all queries routed through the ProxySQL query parser, uncomment the
48following line in the `mysql_variables` section of `test/proxysql/proxysql.cnf`,
49like so:
50
51```ini
52# If mysql_query_rules are marked log=1, they will be logged here. If unset,
53# no queries are logged.
54eventslog_filename="/test/proxysql/events.log"
55```
56
57Then set `log = 1;` for `rule_id = 1;` in the `mysql_query_rules` section, like so:
58
59```
60{
61 rule_id = 1;
62 active = 1;
63 # Log all queries.
64 match_digest = ".";
65 # Set log=1 to log all queries to the eventslog_filename under
66 # mysql_variables.
67 log = 1;
68 apply = 0;
69},
70```
71
72## Sending ProxySQL logs to a file
73
74Replace the `entrypoint:` under `bproxysql` in `docker-compose.yml` with
75`/test/proxysql/entrypoint.sh`. This is necessary because if you attempt to run
76ProxySQL in the background (by removing the `-f` flag) Docker will simply kill
77the container.
View as plain text