歡迎您光臨本站 註冊首頁

在Red Hat Enterprise Linux 5.3 x86_64 安裝 mongod 1.8.1

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

1. 選擇下載安裝包

在官方網站(http://www.mongodb.org/downloads)選擇下載我們所需要的包.

這裡是查看系統多少位方式:

  1. # uname -a
  2. Linux domain_name 2.6.18-128.el5 #x86_64 x86_64 x86_64 GNU/Linux
  3. # cat /etc/redhat-release
  4. Red Hat Enterprise Linux Server release 5.3 (Tikanga)

這裡我們選擇下載mongodb-linux-x86_64-1.8.1.tgz

  1. # cd /tmp
  2. # wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.1.tgz

2.安裝mongod

  1. # tar -xvf mongodb-linux-x86_64-1.8.1.tgz //解壓
  2. mongodb-linux-x86_64-1.8.1/
  3. mongodb-linux-x86_64-1.8.1/THIRD-PARTY-NOTICES
  4. ... ...
  5. # mv mongodb-linux-x86_64-1.8.1 /usr/local/mongodb //移動mongod到指定目錄
  6. # ln -s /usr/local/mongodb/bin/mongod /usr/bin/mongod //為了方便使用創建軟鏈接
  7. # mkdir /data/db //創建默認數據文件目錄
  8. # mongod --shardsvr --port [portnumber] //啟動服務,埠根據需要啟動

3.配置

  1. # mongod --help
  2. Allowed options:
  3. General options:
  4. -h [ --help ] show this usage information
  5. --version show version information
  6. -f [ --config ] arg configuration file specifying additional options
  7. -v [ --verbose ] be more verbose (include multiple times for more
  8. verbosity e.g. -vvvvv)
  9. --quiet quieter output
  10. --port arg specify port number
  11. --bind_ip arg comma separated list of ip addresses to listen on -
  12. all local ips by default
  13. --logpath arg log file to send write to instead of stdout - has to
  14. be a file, not directory
  15. --logappend append to logpath instead of over-writing
  16. --pidfilepath arg full path to pidfile (if not set, no pidfile is
  17. created)
  18. --keyFile arg private key for cluster authentication (only for
  19. replica sets)
  20. --unixSocketPrefix arg alternative directory for UNIX domain sockets
  21. (defaults to /tmp)
  22. --fork fork server process
  23. --auth run with security
  24. --cpu periodically show cpu and iowait utilization
  25. --dbpath arg directory for datafiles
  26. --diaglog arg 0=off 1=W 2

    =R 3=both 7=W some reads
  27. --directoryperdb each database will be stored in a separate directory
  28. --journal enable journaling
  29. --journalOptions arg journal diagnostic options
  30. --ipv6 enable IPv6 support (disabled by default)
  31. --jsonp allow JSONP access via http (has security
  32. implications)
  33. --maxConns arg max number of simultaneous connections
  34. --noauth run without security
  35. --nohttpinterface disable http interface
  36. --noprealloc disable data file preallocation - will often hurt
  37. performance
  38. --noscripting disable scripting engine
  39. --notablescan do not allow table scans
  40. --nounixsocket disable listening on unix sockets
  41. --nssize arg (=16) .ns file size (in MB) for new databases
  42. --objcheck inspect client data for validity on receipt
  43. --profile arg 0=off 1=slow, 2=all

  44. --quota limits each database to a certain number of files (8
  45. default)
  46. --quotaFiles arg number of files allower per db, requires --quota
  47. --rest turn on simple rest api
  48. --repair run repair on all dbs
  49. --repairpath arg root directory for repair files - defaults to dbpath
  50. --slowms arg (=100) value of slow for profile and console log
  51. --smallfiles use a smaller default file size
  52. --syncdelay arg (=60) seconds between disk syncs (0=never, but not
  53. recommended)
  54. --sysinfo print some diagnostic system information
  55. --upgrade upgrade db if needed
  56. Replication options:
  57. --fastsync indicate that this instance is starting from a dbpath
  58. snapshot of the repl peer
  59. --autoresync automatically resync if slave data is stale
  60. --oplogSize arg size limit (in MB) for op log
  61. Master/slave options:
  62. --master master mode
  63. --slave slave mode
  64. --source arg when slave: specify master as <server:port>

  65. --only arg when slave: specify a single database to replicate
  66. --slavedelay arg specify delay (in seconds) to be used when applying
  67. master ops to slave
  68. Replica set options:
  69. --replSet arg arg is <setname>[/<optionalseedhostlist>]
  70. Sharding options:
  71. --configsvr declare this is a config db of a cluster; default port
  72. 27019; default dir /data/configdb
  73. --shardsvr declare this is a shard db of a cluster; default port
  74. 27018
  75. --noMoveParanoia turn off paranoid saving of data for moveChunk. this
  76. is on by default for now, but default will switch

4.結果

  1. # mongod --shardsvr --port 9999
  2. Tue May 24 08:14:04 [initandlisten] MongoDB starting : pid=13314 port=9999 dbpath=/data/db/ 64-bit
  3. Tue May 24 08:14:04 [initandlisten] db version v1.8.1, pdfile version 4.5
  4. Tue May 24 08:14:04 [initandlisten] git version: a429cd4f535b2499cc4130b06ff7c26f41c00f04

  5. Tue May 24 08:14:04 [initandlisten] build sys info: Linux bs-linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
  6. Tue May 24 08:14:04 [initandlisten] waiting for connections on port 9999
  7. Tue May 24 08:14:04 [websvr] web admin interface listening on port 10999

本文出自 「記錄點點滴滴」 博客,請務必保留此出處http://lixiangning.blog.51cto.com/1253969/571728


[火星人 ] 在Red Hat Enterprise Linux 5.3 x86_64 安裝 mongod 1.8.1已經有1068次圍觀

http://coctec.com/docs/linux/show-post-48581.html