生活随笔
收集整理的這篇文章主要介紹了
Mongodb学习(安装篇): 在centos下的安装
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
安裝篇??###下載解壓文件?[root@192?lamp]#?wget?http:??2.2.2.tgz?###解壓文件?[root@192?lamp]#?tar?zxvf?mongodb-linux-i686-2.2.2.tgz??###查看解壓文件?[root@192?lamp]#?ls?mongodb-linux-i686-2.2.2??mongodb-linux-i686-2.2.2.tgz??[root@192?lamp]#?cd?mongodb-linux-i686-2.2.2?[root@192?mongodb-linux-i686-2.2.2]#?ls?bin??GNU-AGPL-3.0??README??THIRD-PARTY-NOTICES?[root@192?mongodb-linux-i686-2.2.2]#?cd?bin/?[root@192?bin]#?pwd?/lamp/mongodb-linux-i686-2.2.2/bin??###將/lamp/mongodb-linux-i686-2.2.2/bin目錄拷貝到/usr/local/mongodb下?[root@192?bin]#?cd?..?[root@192?mongodb-linux-i686-2.2.2]#?ls?bin??GNU-AGPL-3.0??README??THIRD-PARTY-NOTICES??[root@192?mongodb-linux-i686-2.2.2]#?rsync?-a?bin?/usr/local/mongodb??###創建數據存放和日志文件:?[root@192?mongodb-linux-i686-2.2.2]cd?/usr/local/mongodb?[root@192?mongodb]#?mkdir?data?[root@192?mongodb]#?ls?bin??data?[root@192?mongodb]#?touch?dblogs?[root@192?mongodb]#?ls?bin??data??dblogs??###啟動進程(以后臺Daemon形式運行服務)?[root@192?mongodb]#?cd?bin/?[root@192?bin]#?./mongod?--dbpath=/usr/local/mongodb/data/?--??logpath=/usr/local/mongodb/dblogs?--fork??###查看mongod進程?[root@192?bin]#?pstree?-p?|grep?mongod??###寫入計算機啟動文件(跟隨計算機啟動)?[root@192?bin]#?vi?/etc/rc.local?????加入如下:????/usr/local/mongodb/bin/mongod?--dbpath=/usr/local/mongodb/data/?--??logpath=/ur/local/mongodb/dblogs?--fork??查看?cat?/etc/rc.local??關閉服務:(殺掉進程)?pkill?mongod?killall?mongod??查看進程?ps?-ef?|grep?mongod?!ps??殺掉mongodb的鎖文件?[root@192?~]#?cd?/urs/local/mongodb/data?[root@192?data]rm?-rf?mongod.lock? 轉載請注明:?Mongodb學習(安裝篇): 在centos下的安裝 | 唐文博客?
轉載于:https://blog.51cto.com/wen5566/1119109
總結
以上是生活随笔為你收集整理的Mongodb学习(安装篇): 在centos下的安装的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。