我已经使用 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中创建分片集群
发布评论