我想锁定一切 - 完全.非常简单. 只是防止事情发生变化!! 这会有用吗?
use mydatabase;
flush tables with read lock;
Run Code Online (Sandbox Code Playgroud)
...
unlock tables;
Run Code Online (Sandbox Code Playgroud)
编辑:但是,它必须可用于复制.
我正在运行sql服务器复制,以将表同步到单独的(报告)数据库。
在源数据库中,所有记录都有一个DateTime值(不是很常见),但不是存储为DateTime,而是存储为Guid...,它指向包含所有时间戳(每分钟一个)的表。
现在,我想在复制过程中(或最后,或在目标数据库中连续执行)是datetime在TimeStamps数据库中查找时间戳(值),并用该DateTime值填充目标数据库中的额外字段。
这样做的原因是,我可以在特定的日期时间查询目标数据库,而不必将其加入时间戳数据库。
这可能吗?
我已经将复制的属性视为'DTS'属性,这使我认为我可以以某种方式指定DTS包,但是该属性未启用并且我认为DTS已过时?
我在EBS卷上设置了一个带有MySQL的EC2实例,并设置了另一个充当Slave for Replication的实例.复制设置很好.我的问题是拍摄这些卷的快照.我注意到需要为快照过程锁定表,这可能会给用户带来不便.因此,我的想法是单独保留Master实例并拍摄作为slave的实例的快照.这是一个好主意吗?是否有人有类似的设置,并能以正确的方式指导我?
此外,拍摄从属实例的快照需要锁定表.这是否意味着复制会破裂?
提前致谢.
我之前为2台服务器设置了MySQL主/从复制没有问题,我通常在这里关注MySQL网站上的优秀文档.但是这次我已经设置了它,看起来它应该正常工作,但是奴隶没有用主数据中的新数据进行更新.我将显示主服务器和服务器的一些输出.
硕士(IP:10.1.1.21)
show processlist
Run Code Online (Sandbox Code Playgroud)
'107','repl','10 .1.1.22:60686',NULL,'Binlog Dump','523','已将所有binlog发送给slave; 等待binlog更新',NULL
show master status
Run Code Online (Sandbox Code Playgroud)
'mysql-bin.000280','10494','joomla','mysql'
奴隶(IP:10.1.1.22)
show processlist
Run Code Online (Sandbox Code Playgroud)
'9','系统用户','',NULL,'连接','625','等待主发送事件',NULL
'10','系统用户','',NULL,'连接','10','已读取所有中继日志; 等待从I/O线程更新',NULL
show slave status
Run Code Online (Sandbox Code Playgroud)
'等待主人发送事件','10 .1.1.21','repl','3306','60','mysql-bin.000280','14029','tim-Dell-DM061-relay-bin. 000002','14174','mysql-bin.000280','是','是','','','','','','','0','','0 ','14029','14338','无','','0','不','','','','','','0','否','0 ','','0',''
我测试它是否有效的方法是在master上创建一个表.我做了这个,这个新表没有传播给奴隶.我确实检查了中继二进制日志,它确实有很多更新.这是一个网站数据库,我只是检查了点击的数量正在传播到奴隶,所以它似乎工作了一点.
创建表不会传播,我也尝试将一些数据插入到测试表中,当我将初始数据同步到从站时,这些数据也不会传播到从站.
有关如何进一步调试的任何想法?
谢谢!
编辑:
在show global variables like 'replicate%'返回2列:"变量名","价值".没有任何数据行.
试图弄清楚MongoDB Arbiter要申请什么样的机器,以便我可以设置副本集.所有它需要做的是在机器停机时投票,对吧?使用micro EC2实例可能有任何问题吗?
我想改变表中的StudentPerformance列
要改变的列是 -
StudentName varchar(50) to StudentName varchar(100)
Percentage decimal(18,0) to Percentage decimal(18,2)
Run Code Online (Sandbox Code Playgroud)
它配置为合并复制.
我需要在不关闭的情况下进行分片,或者重新启动端口27017中的现有mongo实例.
我尝试了以下,(默认端口正在运行,mongo实例)
mongod --shardsvr --dbpath /var/lib/mongodb/dba --port 10001 > /var/log/mongodb/shardlog/sharda.log &
mongod --shardsvr --dbpath /var/lib/mongodb/dbb --port 10002 > /var/log/mongodb/shardlog/shardb.log &
mongod --configsvr --dbpath /var/lib/mongodb/config --port 20000 > /var/log/mongodb/shardlog/configdb.log &
mongos --configdb localhost:20000 > /var/log/mongodb/shardlog/mongos.log &
Run Code Online (Sandbox Code Playgroud)
然后mongos日志给出错误,
Run Code Online (Sandbox Code Playgroud)Thu Aug 23 14:44:36 [mongosMain] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017 Thu Aug 23 14:44:36 [mongosMain] ERROR: addr already in use
mongos在端口20000上运行,但为什么它试图连接默认的27017端口?
我可以使用多个分片启动mongos而不会干扰端口27017上的现有mongo实例吗?
我在从属端的MySQL复制有错误22,特别是关于charset错误.
该错误表明它找不到charset'#45',我发现它很奇怪,因为使用的查询是陈述的DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci,我确实检查了charset\Index.xml它确实存在.
师父: Server version: 5.5.30-log
奴隶 : Server version: 5.1.66-log
当前复制状态:
mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.2.21
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000024
Read_Master_Log_Pos: 1065715871
Relay_Log_File: mysqld-relay-bin.000029
Relay_Log_Pos: 86980698
Relay_Master_Log_File: mysql-bin.000024
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 22
Last_Error: Error 'Character set '#45' is not a compiled character set and is …Run Code Online (Sandbox Code Playgroud) 在SQL Server 2008 R2中。排队事务复制与合并复制有什么区别?我不明白在两种情况下服务器都不在线(我的情况)。我可以选择其中任何一个吗?
我们的Gerrit项目之一在某个日期之后停止工作,并出现以下错误:
Gerrit日志中的错误/ var / gerrit / logs / error_log:[2016-07-29 17:59:51,676]
com.googlesource.gerrit.plugins.replication.ReplicationQueue错误:无法复制到git@bitbucket.org:company / product.git org.eclipse.jgit.errors.TransportException:git@bitbucket.org:company / product.git:渠道没有打开。在org.eclipse.jgit.transport.JschSession $ JschProcess。(JschSession.java:154)在org.eclipse.jgit.transport.JschSession $ JschProcess。(JschSession.java:118)在org.eclipse.jgit.transport.JschSession org.eclipse.jgit.transport.TransportGitSsh $。 org.eclipse.jgit.transport.Transport.push(Transport.java:1167)的.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:154)org.eclipse.jgit.transport.Transport.push(Transport) com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:307)处的com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:252)处的.java:1213)。 googlesource.gerrit.plugins.replication.PushOne。com.googlesource.gerrit.plugins.replication.PushOne.access $ 000(PushOne.java:71)处的runPushOperation(PushOne.java:207)com.googlesource.gerrit.plugins.replication.PushOne $ 1.call(PushOne.java: 186),位于com.google.gerrit.server.util.RequestScopePropagator的com.google.gerrit.server.util.RequestScopePropagator $ 5.call(Request.Propergator.java:222)的com.googlesource.gerrit.plugins.replication.PushOne $ 1.call(PushOne.java:183)处。 com.google.gerrit.server.git.PerThreadRequestScope $ Propagator $ 1.call(PerThreadRequestScope.java:75)的com.google.gerrit.server.git.PerThreadRequestScope $ Propagator $ 1.call(PerThreadRequestScope.java:75)的com.googlesource.gerrit.plugins .replication.PushOne.run(PushOne.java:183)(位于java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471)位于java.util.concurrent.FutureTask.run(FutureTask.java:262) java.util.concurrent。在com.google.gerrit.server.git.WorkQueue $ Task.run()处的ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:178)在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)。 .java:337),位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145),位于java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615),位于java.lang.Thread.run( Thread.java:745)由以下原因引起:java.lang.Thread.run(Thread.java:745)上的runWorker(ThreadPoolExecutor.java:1145)在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)在原因:java.lang.Thread.run(Thread.java:745)上的runWorker(ThreadPoolExecutor.java:1145)在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)在原因: com.jcraft.jsch.JSchException:通道未打开。在org.eclipse.jgit.transport.JschSession $ JschProcess。(JschSession.java:150)的com.jcraft.jsch.Channel.connect(Channel.java:197)处... 25另外
我们的Gerrit版本是2.6.1,安装在AWS的CentOS 6.8版上。
我的gerrit复制配置是:
[remote "bitbucket"]
url = git@bitbucket.org:qpidhealth/${name}.git
push …Run Code Online (Sandbox Code Playgroud) replication ×10
mysql ×4
master-slave ×3
amazon-ec2 ×2
mongodb ×2
sql-server ×2
bitbucket ×1
database ×1
gerrit ×1
git ×1
jsch ×1
sharding ×1
ssis ×1