Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MongoDB replication instance     - Deploy OpenStack Juno on Ubuntu 14.04 (Linux)

- JavaScript, some conclusions about the implicit conversion (Programming)

- Linux kernel panic (because glibc result) Repair (Linux)

- Oracle 11g DataGuard service to start automatically (Database)

- CentOS 6.4 install and configure Squid Proxy Server (Linux)

- JavaScript common array manipulation functions and usage (Programming)

- CentOS 6.5 installation using a data recovery software extundelete (Linux)

- Linux system security configuration (Linux)

- Red Hat Linux mount U disk (Linux)

- expdp / impdp use version parameter data migration across versions (Database)

- MongoDB version 3.2 WiredTiger storage engine performance tests (Database)

- Oracle Linux 7.1 install Oracle 12C RAC (Database)

- Oracle 11g tracking and monitoring system-level triggers to drop misuse (Database)

- Linux ban single-user mode to enhance system security (Linux)

- SSH without password (Linux)

- LNMP summary of the issues common 502 Bad Gateway (Server)

- How Bluetooth turned off by default in Ubuntu 14.04 (Linux)

- SQL Server 2012 failover looksalive check and is alive check (Database)

- How to determine whether the Linux server was hacked (Linux)

- CentOS install Redis (Database)

 
         
  MongoDB replication instance
     
  Add Date : 2018-11-21      
         
         
         
  MongoDB is a master-slave replication master can be more than they can be mainly from the master-slave replication. Here is a realization of a master server using a database from one server arbitration by providing a different port.

one. Start a MongoDB service name application, port 1234

./mongod --replSet application --dbpath data / node1 --port 1234 --oplogSize 1024


Described the successful launch.
two. Open Client
./mongo --port 1234

three. Start node2, node3
./mongod --replSet application --dbpath data / node2 - port 1235 --oplogSize 1024

./mongod --replSet application --dbpath data / node3 - port 1236 --oplogSize 1024


four. Start the client port 1234
./mongo --port 1234
Fives. Configuration copies
config = {_ id: "application", members: []}
config.members.push ({_ id: 0, host: "localhost: 1234"})
config.members.push ({_ id: 1, host: "localhost: 1235"})
config.members.push ({_ id: 2, host: "localhost: 1236", arbiterOnly: true})

Back 1 Description added successfully
six. rs.isMaster ()

Seven. Master-slave replication test whether
1. In the main server to add a record
1.1 use test
db.user.insert ({_ id: 1, name: "maybo"})


1.2 Open from the service client
./mongo --port 1235

1.3 Queries
use test
db.user.find ( "{})

SlaveOk = false discovery need to be clear from the current node node
1.4 rs.slaveOk ()
show collections

Master-slave replication has been successful, but the main one minute from the time required to copy.
     
         
         
         
  More:      
 
- How LUKS encrypted disk / partition to perform remote incremental backup (Linux)
- To delete the directory and all specified files under the Mac (Linux)
- init level settings for Linux / etc / inittab file into six (restart) or does not support the level of solution (Linux)
- Ubuntu install ruby (Linux)
- Linux file and directory management - ls, cp, mv (Linux)
- The Oracle VM VirtualBox use U disk under ubuntu (Linux)
- Node.JS different ways to install under Ubuntu 15.04 (Linux)
- Ubuntu How to install and upgrade Linux Kernel 3.15 (Linux)
- Ubuntu Linux installation GAMIT10.6 (Linux)
- Linux - EXT2 file system is described in detail (Linux)
- Linux Network Programming - raw socket programming (Programming)
- CentOS yum source configuration (Linux)
- Configuring a Linux operating system against syn attack (Linux)
- Zabbix monitoring platform to extract a single server graphical Python implementation of concurrent (Server)
- Using Ruby to build a simple HTTP service and sass environment (Server)
- Oracle Execute to Parse perform analytical Ratio Analysis (Database)
- Bash Automated Customization Linux belongs to its own CentOS system (Linux)
- CentOS 5.x install Lua 5.2.3 error (LIBS = -lncurses) (Linux)
- AngularJS - Custom instructions (Programming)
- Talking about the implementation and the JVM garbage collection mechanism (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.