Toggle navigation
Home
安装部署
Archives
Tags
Mongodb Installation
环境搭建
数据库
2019-05-06 06:51:53
39
0
0
louyj
环境搭建
数据库
# Install MongoDB Community Edition ## Download the binary files for the desired release of MongoDB. curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.9.tgz ## Extract the files from the downloaded archive. tar -zxvf mongodb-linux-x86_64-3.2.9.tgz ## Copy the extracted archive to the target directory mkdir -p ~/mongodb-3.2.9 mv mongodb-linux-x86_64-3.2.9 ~/mongodb-3.2.9 ## Ensure the location of the binaries is in the PATH variable. export PATH=<mongodb-install-directory>/bin:$PATH # Run MongoDB Community Edition ## Create the data directory Before you start MongoDB for the first time, create the directory to which the mongod process will write data. By default, the mongod process uses the /data/db directory. If you create a directory other than this one, you must specify that directory in the dbpath option when starting the mongod process later in this procedure. mkdir -p /data/mongodb ## Set permissions for the data directory. Before running mongod for the first time, ensure that the user account running mongod has read and write permissions for the directory. ## Run MongoDB ./bin/mongod --noprealloc --smallfiles --dbpath /data/mongodb --auth > ./logs/mongodb.log 2>&1 & ## Create db and user use dbxx db.createUser( { user: "userxx", pwd: "password", roles: [ { role: "dbOwner", db: "dbxx" }, "readWrite"] }, { w: "majority" , wtimeout: 5000 } )
Pre:
Redis集群部署
Next:
Corvus+Redis Cluster
0
likes
39
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.