如何在vBulletin中设置Slave Database配置?

时间:2012-12-06 06:55:01

标签: vbulletin

如何在vBulletin中设置Slave Database配置?我这样设置:

$ config ['Database'] ['dbtype'] ='mysql';

$ config ['数据库'] ['dbname'] ='xyz';

$ config ['Database'] ['tableprefix'] ='vbulletin1 _';

$ config ['数据库'] ['technicalemail'] ='xyz@abc.com';

$ config ['Database'] ['force_sql_mode'] = false;

$ config ['MasterServer'] ['servername'] ='xyz';

$ config ['MasterServer'] ['port'] = 3306;

$ config ['MasterServer'] ['username'] ='x';

$ config ['MasterServer'] ['password'] ='xxxx';

$ config ['MasterServer'] ['usepconnect'] = 0;

$ config ['SlaveServer'] ['servername'] ='abc';

$ config ['SlaveServer'] ['port'] = 3306;

$ config ['SlaveServer'] ['username'] ='a';

$ config ['SlaveServer'] ['password'] ='xxxx';

$ config ['SlaveServer'] ['usepconnect'] = 0;

1 个答案:

答案 0 :(得分:0)

这仅取决于您的从属数据库凭据。而“Slave DB”意味着您已经在主机上复制了数据库(vBulletin无法实现这一点,它应该由您的Web服务器自动完成)。因此,如果您没有复制的数据库,则不应设置Slave DB。

Master-Slave设置用于提高性能。您将写入查询发送到主服务器,并将大多数读取查询发送到从属服务器。它有助于提高性能,因为写查询会根据数据库表类型锁定表/行,而读取则不会。 vBulletin forum