MongoDB 安装、主从配置、以及监控
使用TFTP烧写开发板,基于CentOS 6.4mdash;mdash;TQ2440
1、安装
--------------------------------------------------------------------------------
#添加安装源
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/RedHat/os/x86_64/
gpgcheck=0
enabled=1
#yum 安装
yum install -y mongo-10gen mongo-10gen-server
#添加到开机自动启动
chkconfig mongod on
2、启动,,停止,重启命令
--------------------------------------------------------------------------------
service mongod start
service mongod stop
service mongod restart
3、测试
--------------------------------------------------------------------------------
使用mongoperf 查看磁盘IO性能#mongoperf -h
usage:
mongoperf
{
nThreads:
fileSizeMB:
sleepMicros:
mmf:
r:
w:
recSizeKB:
syncDelay:
}
进行测试:
[root@php1 ~]# cat
nThreads:1,
fileSizeMB:1,
sleepMicros:0,
mmf:'true',
r:'true',
w:'true',
recSizeKB:4,
syncDelay:0
}
#参考Real world MongoDB benchmarks with benchRun
https://blog.serverdensity.com/real-world-mongodb-benchmarks-with-benchrun/
运行mongo
#mongo
>db.foo.insert( { _id : 1 } )
>ops = [{ op :"findOne", ns :"test.foo", query : { _id : 1 } }, { op :"update", ns :"test.foo", query : { _id : 1 } , update : { $inc : { x : 1 } } } ]
[
{
"op":"findOne",
"ns":"test.foo",
"query": {
"_id": 1
}
},
{
"op":"update",
"ns":"test.foo",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
]
>for( x = 1; x... res = benchRun( { parallel : x ,
... seconds : 5 ,
... ops : ops
... } )
... print("threads: "+ x +"\t queries/sec: "+ res.query )
... }
threads: 1 queries/sec: 7886.8
threads: 2 queries/sec: 12786.2
threads: 4 queries/sec: 14891.2
threads: 8 queries/sec: 16361.2
threads: 16 queries/sec: 19811.6
threads: 32 queries/sec: 18343.8
threads: 64 queries/sec: 26470.4
threads: 128 queries/sec: 36110.4
更多详情见请继续阅读下一页的精彩内容:
MongoDB 的详细介绍:请点这里
MongoDB 的下载地址:请点这里
推荐阅读:
Java实现MongoDB中自增长字段
CentOS编译安装MongoDB
CentOS 编译安装 MongoDB与mongoDB的php扩展
CentOS 6 使用 yum 安装MongoDB及服务器端配置
Ubuntu 13.04下安装MongoDB2.4.3
如何在MongoDB中建立新数据库和集合
MongoDB入门必读(概念与实战并重)
《MongoDB 权威指南》(MongoDB: The Definitive Guide)英文文字版[PDF]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]
