Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ MongoDB replication instance     - Compile and install Memcached can not find GCC (Programming)

- Use netcat [nc] command on Linux and Unix port scan (Server)

- NAT and firewall under Linux (Linux)

- Linux vi command list (Linux)

- Ubuntu Linux use MAC binding against ARP attacks (Linux)

- GO five stages of language learning (Programming)

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

- Java threads in the life cycle (Programming)

- How do I upgrade from Ubuntu 15.04 to Ubuntu 15.10 (Linux)

- MySQL Authorized a recovered (Database)

- RHEL5 multipath configuration (Linux)

- Oracle 11g user rights management study notes (Database)

- Nginx load balancing configuration (http proxy) (Server)

- Use rfkill soft-switching and Bluetooth wireless capabilities in Linux (Linux)

- Programmer editor Vim (Linux)

- Using Java program determines whether it is a leap year (Programming)

- Linux --- process tracking (Linux)

- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)

- Java NIO The Glob mode Detailed (Programming)

- Execute command sentence can result in equipment permanently bricked in Linux laptop (Linux)

  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.
- How to Install Node.js in CentOS 7 (Linux)
- B-tree - ideas and implementation of C language code (Programming)
- Several SQL Server data migration / Export Import Practice (Database)
- Related to optimize the use of Btrfs file system on SSD (Linux)
- CentOS7 method to upgrade the kernel to 3.18 (Linux)
- Linux command line ten magic usage (Linux)
- ORA-01839 error caused by incorrect system date setting (Database)
- Linux kernel update error, update-initramfs: failed Solution (Linux)
- Android Studio Getting Started Hello World (Programming)
- RVM installation instructions (Linux)
- Hadoop namenode do NFS disaster recovery (Server)
- Installation and operation GAMIT software under Linux operating system (Linux)
- Dual system Linux (Ubuntu) into the Windows NTFS partition's mount error (Linux)
- RAID configuration and management under linux (Server)
- C ++ Learning Notes: references (Programming)
- To install Ganglia configuration of experience under CentOS 5.5 (Linux)
- Convert MySQL date string to a NULL value exception handling (Database)
- Linux / Unix: chroot command examples to explain (Linux)
- CentOS7 iptables (Linux)
- Ubuntu simple method to track multiple time zones (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.