数据库复制
OK,在创建表时,是否总是假设在一个数据库(主数据库)上创建表意味着 DBA 也应该在从数据库上创建表? 另外,如果使用主/从配置,数据不应该总是从主服务器复制到从服务器以进行同步吗?
现在我遇到的问题是我的数据库在主数据库中有很多东西,但是从数据库缺少仅存在于主数据库中的部分。 这里有什么配置不正确吗?
OK when working with table creation, is it always assumed that creating a table on one database (the master) mean that the DBA should create the table on the slave as well? Also, if using a master/slave configuration, shouldn't data always be getting replicated from the master to the slave to synch?
Right now the problem I am having is my database has a lot of stuff in the master, but the slave is missing parts that only exist in the master. Is something not configured correctly here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
取决于复制的配置方式。 实时复制应该使主从服务器始终保持同步。 “穷人”复制通常配置为在某个时间间隔到期时进行同步。 这就是您的情况可能发生的情况。
Depends how the replication is configured. Real time replication should keep the master and slave in sync at all times. "Poors mans" replication is usually configured to sync upon some time interval expiring. This is whats probably happening in your case.
我更喜欢依靠复制的 CREATE TABLE 语句来在从属设备上设置表,而不是手动创建从属设备的表。 当然,这依赖于 DBMS 的支持。
如果主服务器上有数据但从服务器上没有,那么无论是在设置还是操作上,都会出现某种复制失败。
I prefer to rely on
CREATE TABLE
statements being replicated to set up the table on the slave, rather than creating the slave's table by hand. That, of course, relies on the DBMS supporting this.If you have data on the master that isn't on the slave, that's some sort of failure of replication, either in setup or operationally.
主服务器上的任何表创建都是从服务器上的复制。 插入数据也是如此。
检查 mysql 的 my.cnf 文件中的复制设置,并检查复制时是否忽略任何数据库/表。
Any table creation on master is replication on slave. Same goes with the inserting data.
Go through the replication settings in my.cnf file for mysql and check if any database / table is ignored from replicating.