注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

php开发lamp

《西安--木木》-经历丰富了生活。 架构师QQ群: 246695517

 
 
 

日志

 
 

mongodb安装过程  

2013-06-23 14:37:22|  分类: Nosql |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

linux下mongodb安装


[root@localhost usr]# tar -zvxf mongodb-linux-i686-2.4.4.tar

[root@localhost usr]# ls
mongodb-linux-i686-2.4.4     

[root@localhost usr]# cp -vRp mongodb-linux-i686-2.4.4 /usr/lamp/mongodb
[root@localhost usr]# cd /usr/lamp/mongodb/
[root@localhost mongodb]# ls
bin  GNU-AGPL-3.0  README  THIRD-PARTY-NOTICES
[root@localhost mongodb]# mkdir data

[root@localhost mongodb]# mkdir logs
[root@localhost mongodb]# touch logs/mongodb.log
[root@localhost mongodb]# ls
bin  data  GNU-AGPL-3.0  logs  README  THIRD-PARTY-NOTICES
[root@localhost mongodb]# cd /etc/
[root@localhost etc]# ls
rc.local

      
[root@localhost etc]# vi rc.local
[root@localhost etc]# /usr/lamp/mongodb/bin/mongod --dbpath=/usr/lamp/mongodb/da                   ta --fork --logpath=/usr/lamp/mongodb/logs/mongodb.log
Sun Jun 23 01:55:52.190
Sun Jun 23 01:55:52.191 warning: 32-bit servers don't have journaling enabled by                    default. Please use --journal if you want durability.
Sun Jun 23 01:55:52.191
about to fork child process, waiting until server is ready for connections.
forked process: 2018
all output going to: /usr/lamp/mongodb/logs/mongodb.log
log file [/usr/lamp/mongodb/logs/mongodb.log] exists; copied to temporary file [                   /usr/lamp/mongodb/logs/mongodb.log.2013-06-23T05-55-52]
child process started successfully, parent exiting


[root@localhost etc]# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             Stat                   e
tcp        0      0 *:27017                     *:*                         LIST                   EN
                                                                                           

 

 

 

 

 

 

 

 

 


[root@localhost etc]# cd /usr/lamp/mongodb/
[root@localhost mongodb]# ls
bin  data  GNU-AGPL-3.0  logs  README  THIRD-PARTY-NOTICES
[root@localhost mongodb]# cd bin
[root@localhost bin]# ls
bsondump  mongod     mongoexport  mongoimport  mongoperf     mongos      mongostat
mongo     mongodump  mongofiles   mongooplog   mongorestore  mongosniff  mongotop


 

 

 


[root@localhost bin]# ./mongod --help
Allowed options:

General options:
  -h [ --help ]               show this usage information
  --version                   show version information
  -f [ --config ] arg         configuration file specifying additional options
  -v [ --verbose ]            be more verbose (include multiple times for more
                              verbosity e.g. -vvvvv)
  --quiet                     quieter output
  --port arg                  specify port number - 27017 by default
  --bind_ip arg               comma separated list of ip addresses to listen on
                              - all local ips by default
  --maxConns arg              max number of simultaneous connections - 20000 by
                              default
  --logpath arg               log file to send write to instead of stdout - has
                              to be a file, not directory
  --logappend                 append to logpath instead of over-writing
  --pidfilepath arg           full path to pidfile (if not set, no pidfile is
                              created)
  --keyFile arg               private key for cluster authentication
  --setParameter arg          Set a configurable parameter
  --nounixsocket              disable listening on unix sockets
  --unixSocketPrefix arg      alternative directory for UNIX domain sockets
                              (defaults to /tmp)
  --fork                      fork server process
  --syslog                    log to system's syslog facility instead of file
                              or stdout
  --auth                      run with security
  --cpu                       periodically show cpu and iowait utilization
  --dbpath arg                directory for datafiles - defaults to /data/db/
  --diaglog arg               0=off 1=W 2=R 3=both 7=W+some reads
  --directoryperdb            each database will be stored in a separate
                              directory
  --ipv6                      enable IPv6 support (disabled by default)
  --journal                   enable journaling
  --journalCommitInterval arg how often to group/batch commit (ms)
  --journalOptions arg        journal diagnostic options
  --jsonp                     allow JSONP access via http (has security
                              implications)
  --noauth                    run without security
  --nohttpinterface           disable http interface
  --nojournal                 disable journaling (journaling is on by default
                              for 64 bit)
  --noprealloc                disable data file preallocation - will often hurt
                              performance
  --noscripting               disable scripting engine
  --notablescan               do not allow table scans
  --nssize arg (=16)          .ns file size (in MB) for new databases
  --profile arg               0=off 1=slow, 2=all
  --quota                     limits each database to a certain number of files
                              (8 default)
  --quotaFiles arg            number of files allowed per db, requires --quota
  --repair                    run repair on all dbs
  --repairpath arg            root directory for repair files - defaults to
                              dbpath
  --rest                      turn on simple rest api
  --shutdown                  kill a running server (for init scripts)
  --slowms arg (=100)         value of slow for profile and console log
  --smallfiles                use a smaller default file size
  --syncdelay arg (=60)       seconds between disk syncs (0=never, but not
                              recommended)
  --sysinfo                   print some diagnostic system information
  --upgrade                   upgrade db if needed

Replication options:
  --oplogSize arg       size to use (in MB) for replication op log. default is
                        5% of disk space (i.e. large is good)

Master/slave options (old; use replica sets instead):
  --master              master mode
  --slave               slave mode
  --source arg          when slave: specify master as <server:port>
  --only arg            when slave: specify a single database to replicate
  --slavedelay arg      specify delay (in seconds) to be used when applying
                        master ops to slave
  --autoresync          automatically resync if slave data is stale

Replica set options:
  --replSet arg           arg is <setname>[/<optionalseedhostlist>]
  --replIndexPrefetch arg specify index prefetching behavior (if secondary)
                          [none|_id_only|all]

Sharding options:
  --configsvr           declare this is a config db of a cluster; default port
                        27019; default dir /data/configdb
  --shardsvr            declare this is a shard db of a cluster; default port
                        27018


 

 

 


[root@localhost bin]# ./mongo
MongoDB shell version: 2.4.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
Server has startup warnings:
Sun Jun 23 01:55:52.312 [initandlisten]
Sun Jun 23 01:55:52.312 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sun Jun 23 01:55:52.312 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Sun Jun 23 01:55:52.312 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
Sun Jun 23 01:55:52.312 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Sun Jun 23 01:55:52.314 [initandlisten]

>


如果要让php支持mongodb,还需要给php打模块
#安装re2c-0.13.5.tar.gz
tar -zxvf re2c-0.13.5.tar.gz
cd re2c-0.13.5
./configure
make && make install
#--------------------------------
#安装php的mongo扩展
tar -zxvf mongo-1.4.1.tgz
cd mongo-1.4.1
./configure --with-php-config=/usr/local/php/bin/php-config --enable-mongo
make && make install
#--------------------------------

tar -zxvf mongo-1.2.6.tgz
cd mongo-1.2.6
/usr/lcoal/php/bin/phpize

./configure -h #查看参数
./configure --with-php-config=/usr/local/php/bin/php-config --enable-mongo

cd /usr/lcoal/php/lib/php/extensions/no-debug-non-zts-20060613 #查看mongo.so存在

vi /usr/local/php/etc/php.ini
extension=mongo.so #加入词句

#查看phpinfo(); php是否支持mongo。


  评论这张
 
阅读(1361)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017