Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Different versions of MongoDB achieve master-slave replication     - Advanced Linux security settings (Linux)

- Dom4j change XML coding (Programming)

- Ubuntu 15.10 under Python + Apache + CGI fully configured (Server)

- Understand the security restore accidentally deleted critical system files (Linux)

- Shell script to crawl through AWR SQL Report Problems (Database)

- To setup a ftp server under Linux (Server)

- Thinking in Java study notes - initialization and cleanup (Programming)

- The direct insertion sort algorithm (Programming)

- Ansible installation configuration and simple to use (Server)

- How to configure security management services under Linux (Linux)

- Linux data redirection (Linux)

- Using shell users or virtual users to login to pureftpd (Linux)

- SQL Server 2008 database synchronization Notes (Database)

- Android Dynamic efficiency articles: a brilliant Loading Analysis and Implementation (Programming)

- tar command to extract a file error: stdin has more than one entry (Linux)

- MySQL Authorized a recovered (Database)

- CentOS / Linux restart active NIC connection paths / network configure error Error Resolution (Linux)

- About Leetcode on Binary Tree Algorithm summary (Programming)

- Management and application Oracle external table (Database)

- [Errno 4] IOError: [Errno ftp error] with yum appears as a workaround (Linux)

 
         
  Different versions of MongoDB achieve master-slave replication
     
  Add Date : 2018-11-21      
         
       
         
  MongoDB has a major feature is to copy, copy a variety of forms, including, master-slave replication is more commonly used.

Master-slave replication works: First, there must be two or more servers, one of which is the master node, responsible for handling client requests, the other is from the node, the master node is responsible for mapping data. Master record in all of its operations on the implementation of the operations acquired from node periodically poll the master node, then perform these operations. Since the implementation of the same operation from the node and the master node, the node will be able to keep pace with the data from the master node.

Combat explain MongoDB to build and master-slave replication, because only one server, it can only be realized by changing the port number from MongoDB master, rather than through multiple server implementation. In fact, the principle is the same - just do not particularly meaningful ~

Has been previously installed a version of MongoDB (2.6.11), now that mongodb has been updated to 3.0.6, then from the library will use specially 3.0.6, because it is testing purposes, not Guannameduo ~
 
installation

mongodb Download

Download mongodb3.0.6 executable file package, and extract, the binaries on /usr/local/mongo3.0.6 directory
 
Configuration
 
Main Library Configuration

# Mongod.conf
 
#where to log
logpath = / var / log / mongodb / mongod-27017.log
 
logappend = true
 
# Fork and run in background
fork = true
 
port = 27017
 
# Dbpath = / var / lib / mongo
dbpath = / data / mongodb / mongo-27017
 
# Location of pidfile
pidfilepath = / var / run / mongodb / mongod-27017.pid
 
bind_ip = 127.0.0.1,192.168.56.61
 
# Noauth = true
 
# Ignore query hints
# Nohints = true
 
# Disable the HTTP interface (Defaults to localhost: 27017).
nohttpinterface = false
rest = true
 
master = true
 
From the Library Configuration

# Mongod.conf
 
#where to log
logpath = / var / log / mongodb / mongod-27018.log
 
logappend = true
 
# Fork and run in background
fork = true
 
port = 27018
 
# Dbpath = / var / lib / mongo
dbpath = / data / mongodb / mongo-27018
 
# Location of pidfile
pidfilepath = / var / run / mongodb / mongod-27018.pid
 
# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 127.0.0.1,192.168.56.61
 
# Noauth = true
 
# Ignore query hints
# Nohints = true
 
# Disable the HTTP interface (Defaults to localhost: 27018).
nohttpinterface = false
rest = true
 
slave = true
source = 127.0.0.1:27017
 
start up

# Start the main library
/usr/local/mongo2.6.11/mongod -f /etc/mongod/mongod-27017.conf
 
Start from the library #
/usr/local/mongo3.0.6/mongod -f /etc/mongod/mongod-27018.conf
 
 
Authenticate

  Different versions of mongodb start auth mode can be achieved by the following method

  1. First of all master mode is set unauth from mongodb

  2. Add a master account, so that slave will automatically sync the account

  3. All the main open auth mode from mongodb
     
         
       
         
  More:      
 
- Ubuntu 12.04 configure NVIDIA CUDA 5.5 Record (Linux)
- CentOS 6.7 install Nagios Tutorials (Server)
- KUbuntu / Ubuntu 14.04 (downgrade) installed SVN 1.7 (Linux)
- Fedora && Arch Linux - the most romantic thing to happen now (Linux)
- Kernel compile under Debian (Linux)
- Modifying the system registry protection server security (Linux)
- How to monitor Nginx (Database)
- Ubuntu UFW firewall settings Introduction (Linux)
- open V switch port mirror in OpenStack neutron (Server)
- Linux supports serial output method (Linux)
- To install GCC development environment under SUSE11 (Linux)
- C ++ you can become a new scripting language (Programming)
- The SVN installation, configuration and start - up under Linux (CentOS 6.5) (Server)
- Perl loop (Programming)
- Linux kernel programming parameter passing between modules and function calls (Programming)
- GoldenGate for Oracle data consistency initializing (Database)
- Ubuntu derivative version of the user and how to install SmartGit / HG 6.0.0 (Linux)
- Two programs HAProxy + Heartbeat (note, the secondary server vip, normal HAProxy boot method) (Server)
- Installation and Configuration Munin monitoring server on Linux (Server)
- Spring Boot + Nginx + Tomcat + SSL configuration notes (Server)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.