Mongo DB:无法在Ubuntu中创建分片集群

编程入门 行业动态 更新时间:2024-10-24 20:20:13
本文介绍了Mongo DB:无法在Ubuntu中创建分片集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经使用 docs.mongodb安装了MongoDB. org/manual/tutorial/install-mongodb-on-ubuntu/在我的Ubuntu机器上,并且mongo实例运行正常.

I have installed MongoDB using docs.mongodb/manual/tutorial/install-mongodb-on-ubuntu/ in my Ubuntu machine and the mongo instance is working fine.

我能够在实例中执行CRUD操作.我还安装了MonjaDB eclipse插件,并且能够查看其中的所有数据库/集合/文档.

I am able to do CRUD operations in the instance. I also installed the MonjaDB eclipse plugin and am able to see all databases/collections/documents in it.

现在,我想在我的机器上创建一个分片集群.我正在尝试以这种方式创建:

Now, I want to create a sharded cluster in my machine. I am trying to create this way:

cluster = new ShardingTest({"shards":3,"chunksize":1})

cluster = new ShardingTest({"shards" : 3, "chunksize" : 1})

出现以下错误: 重置数据库路径'/data/db/test0' 周三2月12 15:46:43错误:boost ::文件系统:: create_directory:权限被拒绝:"/data/db/test0"(匿名):1

It is giving the following error: Resetting db path '/data/db/test0' Wed Feb 12 15:46:43 Error: boost::filesystem::create_directory: Permission denied: "/data/db/test0" (anon):1

此外,我尝试为现有集合创建碎片.为此,首先我尝试在数据库中启用分片(测试")

Also, I tried to create shards for existing collection. For this, first I tried to enable sharding in my database ("test")

sh.enableSharding("test") 2月12日星期三15:48:14未捕获的异常:未连接到蒙哥斯

sh.enableSharding("test") Wed Feb 12 15:48:14 uncaught exception: not connected to a mongos

有人可以让我知道,怎么可能出问题了.

Can someone please let me know, what might went wrong.

预先感谢

Raghu

推荐答案

我建议您遵循MongoDB网站上的文档来首次部署分片集群:

I can suggest that you follow the documentation from the MongoDB site to deploy your sharded cluster for the first time:

docs.mongodb/manual/tutorial/deploy -shard-cluster/

如果您随后希望通过另一种产品来帮助实现这一目标,那么您可以更加了解实际需要做的事情和没有发生的事情.

If you then wish to work through another product to aid in this then you can be more aware of what actually needs to be done and what is not happening.

更多推荐

Mongo DB:无法在Ubuntu中创建分片集群

本文发布于:2023-11-28 15:41:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643000.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:集群   分片   Mongo   DB   Ubuntu

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!