简体   繁体   English

64位mongodb多分片问题

[英]64-bit mongodb multiple-shards Issue

I am using 64-bit MongoDB, and i am undergoing test on multiple-shards. 我正在使用64位MongoDB,并且正在对多分片进行测试。 If i keep multiple shards in a single machine. 如果我在一台机器上保留多个碎片。 Its working fine but if i keep shards in different machine, its failed in sharding to second shard. 它的工作正常,但是如果我将分片保留在另一台机器中,则无法将其分片到第二个分片。 I have restricted the first-shard size to 10MB, once its reaches the limited size in first shard it should start sharding to second-shard but not happening so.Instead failed to store in second-shard updating to first shard. 我已将第一个分片的大小限制为10MB,一旦第一个分片的大小达到限制,它应该开始分片为第二个分片,但不会发生这种情况,而是无法将第二个分片更新存储到第一个分片。 The following are my shard details. 以下是我的分片详细信息。 In my environment initially i have two shards. 在我的环境中,最初我有两个碎片。 The first shard is on my first-machine running along with my application. 第一个分片与我的应用程序一起在我的第一台机器上运行。 The Second-shard is on my second machine. 第二个分片在我的第二台计算机上。 Configuration as follows:- *)On both of my shards, shard-server,configserver,mongos and i have connected mongo through mongos as follows ./mongo hostname:27017/admin and i have added both the shards in first & second shard and enabled sharding for database and collection level by using shard-key. 配置如下:-*)在我的两个分片上,分片服务器,configserver,mongos和我通过mongos如下连接mongo。通过使用分片键为数据库和收集级别启用分片。 Please, let me know if i gone wrong anywhere in the configuration. 请让我知道是否在配置中的任何地方出错。

Advance Thanks, 预先感谢,

Your post could use some editing, this is very difficult to read. 您的帖子可能需要进行一些编辑,这很难阅读。

It looks like you have 2 machines. 看来您有2台机器。 On each machine you have: 在每台计算机上,您都有:

  • mongod process serving as one shard mongod进程作为一个碎片
  • mongod process serving as a config mongod进程充当配置
  • mongos process mongos进程
  • a copy of your application connecting to localhost:27017/admin 连接到localhost:27017/admin应用程序的副本

Please, let me know if i gone wrong anywhere in the configuration. 请让我知道是否在配置中的任何地方出错。

There are several possible problems here. 这里有几个可能的问题。 Please check the following: 请检查以下内容:

  1. You can only have 1 or 3 config processes. 您只能有1或3个配置过程。 It looks like you have 2, this will not work. 看来您有2个,将无法使用。
  2. When you connect to localhost:27017/admin are you connecting to mongos or mongod ? 当您连接到localhost:27017/admin ,您是在连接到mongos还是mongod Either one could be running on those ports. 任一端口都可以在这些端口上运行。 Can you specify the ports for each process to help clarify? 您可以为每个进程指定端口以帮助澄清吗? You must connect to mongos or the sharding will not happen. 必须连接到mongos否则分片将不会发生。
  3. Please look at the logs, they generally have output indicating what the server is doing. 请查看日志,它们通常具有指示服务器正在执行的输出。 If there is no indication of "splits" or "chunks" happening, then your database may be configured incorrectly. 如果没有迹象表明发生“分裂”或“块”,则您的数据库可能配置不正确。

Your best bet is to start from top and test each piece one at a time. 最好的选择是从头开始,并一次测试每一块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM