Read and write configuration problems of mongodb master-slave server

I am very happy to come to Sifei website for the first time. Today, I encountered a small problem when I was learning mongodb to configure the master-slave server, that is, when I set the ip and port of the master-slave server, logging in to the master server 192.168.1.102 primary, 27017 and the slave server 192.168.1.102 primary, 27018 packet ID shows that the slave server can be written arbitrarily. It is not that you just logged in to the server and did not switch to the identity of the slave server.

because the master server can not achieve the effect of master and slave, I hope the boss will give us some advice! Thank you very much

the steps to set up the master / slave server are as follows:
Environment: mac version / / MongoDB version: "3.4.2

  1. create database directories db1, db2
    create two directory paths / Users/gavin/Desktop, for suspending two mongodb servers

mkdir db1
mkdir db2
2. Suspend two servers
mongod-- bind_ip 192.168.1.102-- port 27017-- dbpath / Users/gavin/Desktop/db1-- replSet rs0
mongod-- bind_ip 192.168.1.102-- port 27018-- dbpath / Users/gavin/Desktop/db2-- replSet rs0

3. Connect to the primary server. Here, set 192.168.1.102purl 27017 as the primary server

mongo-- host 192.168.1.102-- port 27017
rs.initiate ()

4. Add a copy set
rs.add ("192.168.1.102 br 27018")
5. Check the configuration status rs.status ():
clipboard.png
.

:

at this time.
There is a problem with the connection mode of

. You should use mongo-- host 192.168.1.102-- port 27017 before you know it. Awkward

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e88a6b-ef9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e88a6b-ef9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?