Hello!
I’m bootstrapping a server to install some WordPress sites there, but the database will be managed and hosted in another server. The documentation probably lacks some information or it is incompatible to version 4 of EE. https://easyengine.io/docs/remote-mysql/
What I really want is to run ee site create --type=wp ...
and create the site database transparently, as it would be without an external database. I did a test using socat, that is bundled to easyengine/mariadb docker image and it works, but of course, instead socat, we would use haproxy or something else more robust.
The change I did is in /opt/easyengine/services/docker-compose.yml
global-db:
image: easyengine/mariadb:v4.1.4
restart: always
volumes:
- "db_data:/var/lib/mysql"
- "db_conf:/etc/mysql"
- "db_logs:/var/log/mysql"
environment:
- MYSQL_ROOT_PASSWORD=HOLYCHRISTILEAKEDTHEPASS
command: socat TCP-LISTEN:3306,reuseaddr,fork TCP-CONNECT:db1.digitalocean.com:3306
sysctls:
- net.ipv4.tcp_synack_retries=2
- net.ipv4.ip_local_port_range=2000 65535
- net.ipv4.tcp_rfc1337=1
- net.ipv4.tcp_fin_timeout=15
- net.ipv4.tcp_keepalive_time=300
- net.ipv4.tcp_keepalive_probes=5
- net.ipv4.tcp_keepalive_intvl=15
- net.core.somaxconn=65536
- net.ipv4.tcp_max_tw_buckets=1440000
extra_hosts:
- "db1.digitalocean.com:10.111.111.123"
networks:
- global-backend-network
I also added the file /opt/easyengine/services/mariadb/conf/conf.d/mysql-client.cnf
[client]
host=db1.digitalocean.com:
user=root
password=HOLYCHRISTILEAKEDTHEPASS
After these changes, I could run ee site create ...
as explained in the docs. It was not needed to create database user and schema manually, neither add --dbname
, --dbpass
or --dbhost
.
So, it is possible to have an ee command to setup the global-db to use an external service?
Thank you,