下载https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.11.tgz 最新版,这个是linux64位下载地址,你也可以到首页自己选择
解压tar vxf mongodb-linux-x86_64-2.4.11.tgz,解压完之后,进入到根(/)目录,创建data/db文件夹
进入解压完之后的mongodb文件夹,进入bin目录,运行./mongod,发现出现错误信息:Please make at least 3379MB available in /data/db/journal or use --smallfiles,提示空间不够
这个时候使用命令:./mongod --smallfiles来进行启动,如果继续提示空间不够,那么需要删除一些压缩包,来释放空间
如果你需要进入MongoDB后台管理,你需要先打开mongodb装目录的下的bin目录,然后执行mongo命令文件。命令是[root@centos bin]# ./mongo
在比MongoDB服务的端口多1000的端口上,你可以访问到MondoDB的web用户界面。如:如果你的MongoDB运行端口使用默认的27017,你可以在端口号为28017访问web用户界面。
logpath=../log/mongodb.log
logappend=false
dbpath=/root/Downloads/data/db
fork=true
|
[root@centos bin]# ./mongod -f ../etc/mongo.conf --smallfiles warning: remove or comment out this line by starting it with '#', skipping now : logappend=false about to fork child process, waiting until server is ready for connections. forked process: 5217 all output going to: /root/Downloads/mongodb-linux-x86_64-2.4.11/bin/../log/mongodb.log log file [/root/Downloads/mongodb-linux-x86_64-2.4.11/bin/../log/mongodb.log] exists; copied to temporary file [/root/Downloads/mongodb-linux-x86_64-2.4.11/bin/../log/mongodb.log.2014-10-13T03-37-09] child process started successfully, parent exiting [root@centos bin]# |
logpath=../log/mongodb.log
logappend=false
dbpath=/root/Downloads/data/db
fork=true
|
[ root@centos bin]# ./mongod -f ../etc/mongo.conf --smallfiles
warning: remove or comment out this line by starting it with '#', skipping now : logappend=false about to fork child process, waiting until server is ready for connections. forked process: 5217 all output going to: /root/Downloads/mongodb-linux-x86_64-2.4.11/bin/../log/mongodb.log log file [/root/Downloads/mongodb-linux-x86_64-2.4.11/bin/../log/mongodb.log] exists; copied to temporary file [/root/Downloads/mongodb-linux-x86_64-2.4.11/bin/../log/mongodb.log.2014-10-13T03-37-09] child process started successfully, parent exiting [ root@centos bin]# |