Magento 2 MySQL Cluster
Installation Instructions
- composer require
myvitamins/m2-mysql-cluster
- add configuration into app/etc/env.php
Navigate to section db -> connection -> default
add a new section:
'slave-servers' =>
[
0 =>
[
'host' => '<mysql_slave_server>',
'dbname' => '<mysql_slave_db_name>',
'username' => '<mysql_user_name>',
'password' => '<mysql_user_pass>',
'model' => 'mysql4',
'engine' => 'innodb',
'initStatements' => 'SET NAMES utf8;',
'active' => '1',
]
]
Add there as many slave servers as you have.
bin/magento deploy:mode:set production