Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ MongoDB replication instance     - Puppet subcommands Introduction (Server)

- Linux system security norms (Linux)

- Java to achieve local fileCopy (Programming)

- Linux crontab command format example (Linux)

- GNU Linux system variables (sysctl configuration commands) integrated use (Linux)

- SecureCRT connect virtual machine Linux system (Ubuntu) (Linux)

- Python closure and function objects (Programming)

- Analytical Ceph: handle network layer (Server)

- Pydev installed and configured on the Eclipse (Linux)

- SQL Server 2008 database synchronization Notes (Database)

- DOM event handlers add notes (Programming)

- Linux dd command applies amplification SWAP partition (Linux)

- Inject script commands manually annotated summary (Linux)

- CentOS yum source configuration (Linux)

- C # get the current screenshot (Programming)

- File encryption and decryption of Linux security mechanisms (Linux)

- ORA-01157 & ORA-01110 Troubleshooting (Database)

- Linux iptables firewall settings (Linux)

- Standard and IO redirection (Linux)

- Fedora 22 installation and configuration optimization (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.
- Easily create RPM packages using the FPM (Linux)
- Linux uses shared memory communication process synchronization Withdrawal (Programming)
- New features of Java 9 HTTP2 and REPL (Programming)
- Why not use the ifconfig command under RedHat Linux 5 (Linux)
- Difference Redhat5 and 6 YUM source configuration (Linux)
- Analysis of Java keyword final (Programming)
- xCAT deployment (Linux)
- NET Developers need to know some Linux commands (Linux)
- Performance Diagnosis of 60,000 milliseconds for Linux (Linux)
- Sublime Text 3 practical functions and shortcut keys used to collect (Linux)
- Graphing tool: Gnuplot (Linux)
- To access an Oracle database using Instant Client (Database)
- [SHELL] MySQL primary recovery solution from + Keepalived online (Server)
- How to use Quagga BGP (Border Gateway Protocol) router to filter BGP routing (Linux)
- Remote database using RMAN recovery test (RAC return to single-instance database) (Database)
- Ubuntu Linux to create and increase the Swap partition tutorial (Linux)
- You know the difference between URL, URI and URN among you (Linux)
- JavaScript property of checkbox.disabled (Programming)
- FastDFS installation and deployment (Server)
- Android using shape drawable material production (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.