Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Requires: phpFox version >= 4.3.0

...

1. Setup Master and Slaver Mysql server.

There are many tutorials to setup master and slaver mysql server. You can reference these link:

https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

https://dev.mysql.com/doc/refman/5.7/en/replication-setup-slaves.html

This tutorial requires advanced knowledge. We recommend you get professionals to do this if you are not at an advanced level.

...

Login ssh to php server, then try to connect to Master and Slaver server

Code Block
bash
bash

mysql -u username -h MASTER_SERVER_IP -p
Code Block
bash
bash

mysql -u username -h SLAVER_SERVER_IP -p

If you can't connect to Master or Slaver server, you can follow this https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/ to update it.

3. Change phpFox configuration.

Update file PF.Base/file/settings/server.sett.php

Code Block
php
php

<?php
$_CONF['db']['driver'] = 'mysqli'; 
$_CONF['db']['host'] = 'master_server_ip'; // host
$_CONF['db']['user'] = 'username';
$_CONF['db']['pass'] = 'pass';
$_CONF['db']['name'] = 'name';
$_CONF['db']['prefix'] = 'phpfox_';
$_CONF['db']['port'] = '3306';

$_CONF['db']['slave'] = true;
$_CONF['db']['slave_servers'] = [ 
    [
     'host'=>'slave_ip',
     'user'=>'slave_user',
     'pass'=>'slave_pass',
     'port'=>'slave_port'
    ] 
];