ped*_*ler 7 linux installation redhat mongodb
我已经安装了 2.4 mongoDB 版本,我想与最近发布的 2.6 版本进行比较。
我想知道是否可以进行全新安装而不是更新以查看这两个版本是否可以在同一服务器中共存。
我现在正在使用 Linux red-hat 发行版。
谢谢。
看一下Thomas Rueckstiess的mlaunch工具。一旦您按照注释中的建议从下载页面下载了不同版本的二进制文件(并将它们放在对您的系统有意义的位置),您就可以通过指定不同的二进制路径(和数据目录,端口等(如果并行运行多个)。mlaunch
如果额外的工具不是您想要的,您可以使用 MongoDB 提供的内部测试命令获得类似的结果,但请注意,这些命令目前被视为用于测试目的的内部命令,没有记录在案,并且可以更改(或停止工作) )随时(我最近在 2.4 和 2.6 版本上进行了测试,并且可以确认它们在撰写此答案时适用于这些版本)。
例如,如果您想设置一个 2 分片集群,其中每个分片都是一个副本集,您可以执行以下操作:
// start a shell from the command line, do not connect to a database
./mongo --nodb
// using that shell start a new 2 shard cluster (this will take a while)
cluster = new ShardingTest({shards : 2, rs : true});
// once that is finished, start a new shell and connect to the mongos (leave previous shell running to monitor logs etc.)
./mongo --port 30999
MongoDB shell version: 2.6.0
connecting to: 127.0.0.1:30999/test
mongos>
Run Code Online (Sandbox Code Playgroud)
根据需要重复并重新使用您想要的任何版本,要关闭它,只需使用Ctrl-C原始 shell(希望事情仍在记录)。
同样,如果您只想使用副本集进行测试:
// start a shell from the command line, do not connect to a database
./mongo --nodb
var rst = new ReplSetTest({ name: 'testSet', nodes: 3});
rst.startSet();
// this next line can be hard to type with logging scrolling by, so copy & paste is your friend if you have trouble
rst.initiate();
// start a new shell and connect to the set
./mongo --port 31000
MongoDB shell version: 2.4.9
connecting to: 127.0.0.1:31000/test
testSet:PRIMARY>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6364 次 |
| 最近记录: |