Skip to content

Magento 2 CE SQL cluster enabled Magento 2 CE to work with database replication

Notifications You must be signed in to change notification settings

rakibabu/Magento-2---MySQL-Cluster

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2 MySQL Cluster

Installation Instructions

  1. composer require myvitamins/m2-mysql-cluster
  2. 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.

  1. bin/magento deploy:mode:set production

About

Magento 2 CE SQL cluster enabled Magento 2 CE to work with database replication

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%