- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在测试环境中连接到 mongo 查询路由器(我只设置一个查询路由器进行测试 -> 指向一个配置服务器(而不是三个),而配置服务器又指向一个没有副本的两节点分片) 。我可以使用 mongo shell 插入/获取文档(并已验证文档将发送到分片节点)。但是,当我尝试测试与 mongo 数据库的连接时,我得到了下面复制的输出(正在使用的代码也复制在下面)。我正在使用 mongo 数据库 v3.2.0 和 java 驱动程序 v3.2.2 (我正在尝试使用异步 api)。
[info] 14:34:44.562 227 [main] MongoAuthentication INFO - testing 1
[info] 14:34:44.595 260 [main] cluster INFO - Cluster created with settings {hosts=[192.168.0.1:27018], mode=MULTIPLE, requiredClusterType=SHARDED, serverSelectionTimeout='30000 ms', maxWaitQueueSize=30}
[info] 14:34:44.595 260 [main] cluster INFO - Adding discovered server 192.168.0.1:27018 to client view of cluster
[info] 14:34:44.652 317 [main] cluster DEBUG - Updating cluster description to {type=SHARDED, servers=[{address=192.168.0.1:27018, type=UNKNOWN, state=CONNECTING}]
[info] Outputting database names:
[info] 14:34:44.660 325 [main] cluster INFO - No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=SHARDED, connectionMode=MULTIPLE, all=[ServerDescription{address=192.168.0.1:27018, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
[info] Counting the number of documents
[info] 14:34:44.667 332 [main] cluster INFO - No server chosen by ReadPreferenceServerSelector{readPreference=primaryPreferred} from cluster description ClusterDescription{type=SHARDED, connectionMode=MULTIPLE, all=[ServerDescription{address=192.168.0.1:27018, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
[info] - Count result: 0
[info] 14:34:45.669 1334 [cluster-ClusterId{value='577414c420055e5bc086c255', description='null'}-192.168.0.1:27018] connection DEBUG - Closing connection connectionId{localValue:1}
正在使用的部分代码
final MongoClient mongoClient = MongoClientAccessor.INSTANCE.getMongoClientInstance();
final CountDownLatch listDbsLatch = new CountDownLatch(1);
System.out.println("Outputting database names:");
mongoClient.listDatabaseNames().forEach(new Block<String>() {
@Override
public void apply(final String name) {
System.out.println(" - " + name);
}
}, new SingleResultCallback<Void>() {
@Override
public void onResult(final Void result, final Throwable t) {
listDbsLatch.countDown();
}
});
所使用的枚举负责读取配置选项并将 MongoClient 引用传递给其调用者。枚举本身调用其他类,如果需要的话我也可以复制它们。我为 ReadPreference 配置了以下选项:
mongo.client.readPreference=PRIMARYPREFERRED
对我可能做错了什么或可能误解了什么有什么想法吗?目标是通过 mongos(查询路由器)连接到分片,以便我可以在 Mongo 分片中插入/获取文档。
最佳答案
mongo 分片设置(查询路由器、配置和带有副本集的分片)未正确配置。确保首先启动配置服务器副本集,启动 mongos(查询路由器)并指向这些配置服务器,启动 mongo 分片,然后也通过查询路由器(mongos)注册分片因为集合已启用分片。显然,请确保驱动程序正在连接到 mongos(查询路由器)进程。
关于java - 通过java驱动程序连接到mongo shard 3.2.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38107724/
1、SQL解析 当Sharding-JDBC接受到一条SQL语句时,会陆续执行 SQL解析 => 查询优化 => SQL路由 => SQL改写 => SQL执行 =>结
1、读写分离简介 对于同一时刻有大量并发读操作和较少写操作类型的应用系统来说,将数据库拆分为主库和从库,主库负责处理事务性的增删改操作,从库负责处理查询操作,能够有效的避免由数据更新导致的行锁,使得
将从各个数据节点获取的多数据结果集,组合成为一个结果集并正确的返回至请求客户端,称为结果归并。也是Sharding 执行过程 SQL解析 => 执行器优化 => SQL路由 => S
ShardingSphere采用一套自动化的执行引擎,负责将路由和改写完成之后的真实SQL安全且高效发送到底层数据源执行。 它不是简单地将SQL通过JDBC直接发送至数据源执行;也并非直接将执行请求放
Sharding-jdbc 官方文档讲的不是很全面和清楚,学习的时候特意再记录补充下 官方文档地址:http://shardingsphere.apache.org/index_zh.html 一
1.详细报错信息: Caused by: org.apache.ibatis.exceptions.PersistenceException: ## Error updating database.
I'm building a niche social media DB on planetscale that spans users living in multiple countries
在 keras/tensorflow 中训练模型时: 代码片段: strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy()
背景:之前的项目做读写分离的时候用的 MybatisPlus的动态数据做的,很多地方使用的@DS直接指定的读库或者写库实现的业务;随着表数据量越来越大,现在打算把比较大的表进行水平拆分,准备使用
基础分库 以下实例基于shardingsphere 4.1.0 + SpringBoot 2.2.5.RELEASE版本 依赖导入: UTF-8 UTF-8 2.2.5.RE
我有兴趣在多个服务器上分割我的网站用户数据。 例如,用户将从同一位置登录。但登录脚本需要弄清楚用户数据驻留在哪个服务器上。因此,登录脚本将在主注册表中查询该用户名,并且可能会返回该用户名位于服务器 B
最近我们团队的D-SMART在做蚂蚁的OCEANBASE的适配,因此又把OB的资料拿出来,重新做研究。要想让D-SMART纳管OCEANBASE,不像一些传统的监控软件那么简单,只要把一些关键指标接
本文基于shardingsphere-jdbc-core-spring-boot-starter 5.0.0,请注意不同版本的sharding-jdbc配置可能有不一样的地方,本文不一定适用于其它版本
我想在 arangoDB 中使用分片。我已经制作了协调器,如文档 2.8.5 中提到的 DBServers。但是仍然有人仍然可以详细解释它,以及我如何能够在分片前后检查查询的性能。 最佳答案 可以测试
我读到每个 kinesis 流可以有多个消费者应用程序。 http://docs.aws.amazon.com/kinesis/latest/dev/developing-consumers-with
我正在使用一个预先存在的 bash 文件为开源数据服务器(Zotero)设置一系列数据库,但我遇到了一个我不熟悉的 mysql 结构: MASTER="mysql -h localhost -P 33
我们遇到了一个生产事件,Elasticsearch 集群健康检查返回了 red 状态。健康检查报告显示 marvel-2019.06.20 有 2 个 unassigned_shards,这似乎是根本
我在分布式系统中遇到分片移动问题。 【问题】 最初每个分区负责任意数量的分片。 (这个数字可以是任意的,因为系统支持将分片从一个分区移动到另一个分区) 然后一个新的分区来了,系统需要重新分片。目标是使
Sharding-JDBC中的分片策略有两个维度,分别是: 数据源分片策略(DatabaseShardingStrategy) 表分片策略(TableShardingStrategy)
1、Sharding 的应用场景一般都那些? 当数据库中的数据量越来越大时,不论是读还是写,压力都会变得越来越大。试想,如果一张表中的数据量达到了千万甚至上亿级别的时候,不管是建索引,优化缓存等,
我是一名优秀的程序员,十分优秀!