mongodb 3.0版本安裝

來源:互聯網
上載者:User

標籤:

參考官方文檔

windows平台安裝

直接執行的結果:

1.通過瀏覽器下載,不用迅雷:https://www.mongodb.org/downloads?_ga=1.146766260.1274531242.1445581450#production

2.基本的設定檔:mongod.cfg
-----內容
systemLog:
destination: file
path: c:\data\log\mongod.log
storage:
dbPath: c:\data\db

註:啟動時,也可以指定資料目錄:C:\mongodb\bin\mongod.exe --dbpath “d:\test\mongodb\data”

#3.啟動安裝:"C:\mongodb\bin\mongod.exe" --config "C:\mongodb\mongod.cfg" --install

#註:沒有註冊服務時,安裝完畢,最後會停留在顯示提示資訊的地方,此刻已經安裝完畢,開啟其他視窗執行命令。


3.若是雙擊.msi 包執行的安裝---手動建立服務。
 命令:sc.exe create MongoDB binPath= "C:\mongodb\bin\mongod.exe --service --config=\"C:\mongodb\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"

 

redhat linux安裝


1、配置yum倉庫。
<1>建立一個檔案:/etc/yum.repos.d/mongodb-enterprise.repo
---內容---
[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/stable/$basearch/
gpgcheck=0
enabled=1


<2>建立帶版本號碼的yum倉庫。<2.4和2.6都可以,但是2.5不適用生產環境>。
建立一個檔案:/etc/yum.repos.d/mongodb-enterprise-2.6.repo
---內容----
[mongodb-enterprise-2.6]
name=MongoDB Enterprise 2.6 Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/2.6/$basearch/
gpgcheck=0
enabled=1


2.安裝穩定版

命令:sudo yum install -y mongodb-enterprise

#安裝指定版本:
sudo yum install -y mongodb-enterprise-2.6.1 mongodb-enterprise-server-2.6.1 mongodb-enterprise-shell-2.6.1 mongodb-enterprise-mongos-2.6.1 mongodb-enterprise-tools-2.6.1


3.避免意外升級包:
-----在/etc/yum.conf 檔案中寫下如下語句-----
exclude=mongodb-enterprise,mongodb-enterprise-server,mongodb-enterprise-shell,mongodb-enterprise-mongos,mongodb-enterprise-tools

4.啟動

手動啟動:sudo service mongod start
隨機器啟動:sudo chkconfig mongod on

.rpm包中包含很多內容:

1.mongodb-enterprise-server
2.mongodb-enterprise-mongos
3.mongodb-enterprise-shell
4.mongodb-enterprise-tools
也包含很多初始化指令碼:
mongod.conf設定檔,可以配置資料目錄和日誌目錄==

The default /etc/mongod.conf configuration file supplied by the 3.0 series packages has bind_ip set to 127.0.0.1 by default.#已經預設綁定本地地址。
Modify this setting as needed for your environment before initializing a replica set.#若叢集, 更改ip地址。

mongodb 3.0版本安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.