colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
219 stars 103 forks source link

Databases #112

Closed SowAbdoul closed 1 year ago

SowAbdoul commented 1 year ago

Hello @colinmollenhour I have problems, I have two applications, in the creation of the galera cluster, I defined a first database, but in reality I need two different databases. I tried to mount a volume, failure. How can I create two databases when deploying the stack?

Second problem, with the root user, I can't connect to adminer with the password MYSQL_ROOT_PASSWORD I get the error: Access denied and only MYSQL_USER has the right to connect from any host. But in the container, in localhost, it's work

colinmollenhour commented 1 year ago

See "Initializing a fresh instance" on the mariadb base image page: https://hub.docker.com/_/mariadb/

Did you try updating MYSQL_ROOT_PASSWORD? The default is 127.0.0.1 - try using %, for example

SowAbdoul commented 1 year ago

Thanks, I had already found the solution. Sorry, I would like you to help me, I used your example seed and node, I have to intervene manually, I wonder if it is possible to write only one service and indicate replicas: 3, we could pass it seed and node as arguments... Actually I tried, but I got errors in each of my YAMLs. Can you help me?

colinmollenhour commented 1 year ago

I have not devised a way to have three nodes which have never been booted before to communicate and pick one to be the initial node, which I think is what would be required. It would be interesting but I do not have the time to work on this, unfortunately. I'd be happy to review a PR if you want to contribute such a feature.

SowAbdoul commented 1 year ago

Why not, we can talk about later. Right now, I'd like to deploy an application, but I have these errors :

| 2023-05-05 17:43:54 140387251173120 [Warning] Aborted connection 10 to db: 'unconnected' user: 'system' host: '127.0.0.1' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 17:54:02 140387250558720 [Warning] Aborted connection 18 to db: 'powerdns' user: 'root' host: '175.0.7.31' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:14:04 140386845738752 [Warning] Aborted connection 42 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.31' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:14:05 140386845431552 [Warning] Aborted connection 41 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:17:29 140387251173120 [Warning] Aborted connection 17 to db: 'powerdns' user: 'root' host: '175.0.7.31' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:17:29 140386846045952 [Warning] Aborted connection 34 to db: 'powerdns' user: 'root' host: '175.0.7.40' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:17:29 140386846353152 [Warning] Aborted connection 33 to db: 'powerdns' user: 'root' host: '175.0.7.40' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:17:29 140387247548160 [Warning] Aborted connection 32 to db: 'powerdns' user: 'root' host: '175.0.7.38' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:17:29 140387250558720 [Warning] Aborted connection 31 to db: 'powerdns' user: 'root' host: '175.0.7.38' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:17:30 140387250251520 [Warning] Aborted connection 26 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.40' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:28:59 140386846045952 [Warning] Aborted connection 46 to db: 'powerdns' user: 'root' host: '175.0.7.40' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 18:56:51 140387251173120 [Warning] Aborted connection 45 to db: 'powerdns' user: 'root' host: '175.0.7.40' (Got an error reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 19:09:16 140387251173120 [Warning] Aborted connection 51 to db: 'powerdns' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 19:09:16 140386846045952 [Warning] Aborted connection 52 to db: 'powerdns' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-05 19:50:37 140386846045952 [Warning] Aborted connection 58 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.31' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09  7:47:40 140386846045952 [Warning] Aborted connection 397 to db: 'powerdns' user: 'root' host: '175.0.7.40' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09  8:17:33 140386846045952 [Warning] Aborted connection 403 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09  8:30:40 140386846045952 [Warning] Aborted connection 416 to db: 'powerdns' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09  8:30:40 140386845431552 [Warning] Aborted connection 417 to db: 'powerdns' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09  8:30:59 140386845738752 [Warning] Aborted connection 420 to db: 'powerdns' user: 'root' host: '175.0.7.31' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09  9:45:14 140386846045952 [Warning] Aborted connection 429 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09 10:20:45 140386846045952 [Warning] Aborted connection 452 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09 12:08:12 140386846045952 [Warning] Aborted connection 476 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09 12:18:13 140386846045952 [Warning] Aborted connection 480 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09 16:28:21 140386846045952 [Warning] Aborted connection 529 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09 16:38:22 140386845738752 [Warning] Aborted connection 535 to db: 'powerdnsadmin' user: 'root' host: '175.0.7.38' (Got timeout reading communication packets)
galera_node.1.nhg2su1wj6k5@pdns-node-01    | 2023-05-09 17:57:36 140387251173120 [Warning] Aborted connection 412 to db: 'powerdns' user: 'root' host: 'localhost' (Got timeout reading communication packets)
SowAbdoul commented 1 year ago

It's all about MySQL connections - MySQLdb.OperationalError: (2013, 'Lost connection to server during query') Do you have maybe some limits on MySQL side? There is limit for simultaneous connections in MySQL, maybe some other. It could explain why there's a problem with more containers, and more connections.

colinmollenhour commented 1 year ago

I don't offer general MySQL support here, this repo issue board is only for issues specific to the custom functions of this continer image. I don't think lost connections and timeouts are likely to be issues with this project but if you are able to prove otherwise please feel free to reopen this task.