Kubernetes How to manage pods using Replicationcontroller, Replica Set, deployment53746273The pod is literally a pod, and we can think of the container as a bean in a pod, and one or more closely related beans wrapped together as pods (a pod). In the k8s we do not directly manipulate the container, but instead wrap the container into pods, and for the pod, how do
"}, {_id:1, Host:"mongodb-1.mongodb.basic-app.svc.cluster.local:27017"}, {_id:2, Host:"mongodb-2.mongodb.basic-app.svc.cluster.local:27017" } ]});2. Create an administrative user: For specific reference: https://docs.mongodb.com/manual/tutorial/enable-authentication/Use admindb.createuser ({User:"Myuseradmin", pwd:"[email protected]", roles: [{role:"Useradminanydatabase"Db:"Admin"}]}) Db.auth ("Myuseradmin","[email protected]")3, after you can connect to create users, give role permissions to
Deployment advantages relative to RCRS and deployment are mainly used to replace RC. RS is all called Replica Set. The advantages relative to rc,rs and deployment are as follows:
RC only supports equation-based selector, such as Env=dev or ENVIRONMENT!=QA. However, in RS, a new set-based selector, such as version in (v1.0,v2.0) or env not in (DEV,QA), is
Label:This is a document written last year, the recent sudden discovery has not been issued, so now fill in, hoping to help some friends. Because there was no record at the time, it might seem monotonous here.First, the basic environment:mongdb3.0.5 DatabaseSpring-data-mongodb-1.7.2.jarMongo-java-driver-3.0.2.jarlinux-redhat6.3Tomcat7Second, build MongoDB replica set:1, respectively, install MongoDB on thre
MongoDB replica set converts an existing single-node server to a replica set
Server Status:
Existing single-node Primary 192.168.126.9: 27017
New node Secondry 192.168.126.8: 27017
Arbitration node ARBITER 192.168.126.8: 27018
Mongo version 3.2.4
1. Stop the Mongo service for a Single-node Primary
1 > use admin; 2 swi
Tags: mongodb mongo mongodb replica set MongoDB replica setExperimental construction of a cluster to do practiced hand.Configuration and Environment:Win10 (native) and Linux (CENTOS7) intranet servers each.Mongodb3.07Target: Replica set
Next blog post:Http://www.cnblogs.com/xiaoit/p/4479066.html1: First create 3 virtual machines as configuration environmentip1:192.168.91.128ip2:192.168.91.129ip3:192.168.91.1302: Download MongoDB 2.6 versionHttps://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.9.zip3: UnzipTAR-ZXVF Mongodb-linux-x86_64-2.6.9.zipMV mongodb-linux-x86_64-2.6.9 MongoDB 4: Create data directory and log directory and conf configuration file in MongoDB directoryBoth data and log directories are guaranteed
mongodump.log
Step 3: Restore the database on the new instance
Mongorestore must be run when mongod is not started. It writes directly to the file.
mongorestore --host=192.168.11.2:27017 --oplogReplay --dbpath /data/var/lib/mongodb --directoryperdb /nfspool/mongodata > mongorestore.log 2>1
You can view the log data in real time and observe the recovery progress.
tail –f mongorestore.log
Step 4: rebuild the oplog on the new instance
1. view the maintenance window and oplog size of the
Com.mongodb.connection.BaseCluster.createTimeoutException ( basecluster.java:377) at Com.mongodb.connection.BaseCluster.selectServer (basecluster.java:104) at Com.mongodb.bind Ing. Clusterbinding$clusterbindingconnectionsource.
One of the words is that
{address=127.0.0.1:27017, type=replica_set_secondary, roundtriptime=1.3 MS, state=connected}
It means 127.0.0.1:27017. This server is a Secondary,mongo driver that cannot write data to the secondary node, suspected MONGO primary and secondary s
() > Db.createcollection ("oplog.rs", {"capped": true, "size": 23 * 1024 * 1 024 * 1024}) or > Db.runcommand ({create: "oplog.rs", Capped:true, Size: (23 * 1024 * 1024 * 1024)})Step five: Restore Oplog on a new instanceThis oplog is an exported Oplog.bson when mongodump.Mongorestore-d local-c Oplog.rs/nfspool/mongodata/oplog.bsonStep Six: Start a new instance with a replica setThe new instance configuration and the source
Mongodb3.0.5 replica set setup and spring and Java connection replica set configuration details
First, the basic environment:
mongdb3.0.5 DatabaseSpring-data-mongodb-1.7.2.jarMongo-java-driver-3.0.2.jarlinux-redhat6.3Tomcat7
Second, build MongoDB replica
This is a document written last year, recently found that there is no hair, so now make up, I hope to be helpful to some friends. Because there was no screenshot at the time, it might seem monotonous here.
first, the basic environment:
mongdb3.0.5 Database
Spring-data-mongodb-1.7.2.jar
Mongo-java-driver-3.0.2.jar
linux-redhat6.3
Tomcat7
Second, build MongoDB replica set:
1. Install MongoDB on three Linux
1: Replica Set configuration reference this blog:Http://www.cnblogs.com/xiaoit/p/4478951.html2: Authentication of replica setSuppose there are two machines that have been configured with a replica set (the crime of replica
--fork--port 28014--dbpath/data/set/r4--logpath=/data/set/log/ R4.log--logappend--fastsync5.rs.add ("localhost:27017")6. Delete the node:Execute Rs.remove ("Ip:port") above the master nodeThe secondary node in the replica set is not readable by default. in applications where there is less write-read, the
Tags: replica set replica set for MongoDB cluster construction1. Environment:Open four MongoDB instances on a single server to implement the cluster setup of MongoDB's replica set replica
Mongodb replica set priority settings, mongodb replica priorityWhen you set a mongodb replica set, the Primary node, second node, and arbitration node may have unbalanced resource configurations (CPU or memory). Therefore, some no
nodes (including the original active node) is rolled back and then synchronized with the current active point. Other nodes cannot be candidates for active nodes until synchronization
Environment building, set up file directory ms\set1\db, log, config file ms\set2\db, log, config file ms\set2\db, log, config file
1. The configuration file is as follows:
Example 1
Dbpath=d:\msset\set1\db
Logpath=d:\msset\set1\s1.
Tags: basic high Availability Report multithreaded members instead of deploying cells to be aggressiveI. Basic concepts of replica sets Replica set (replica set) MongoDB's replica set i
data, enter the use
gabdb
db.user.insert ({dataid : 10001})
Db.user.find ()
Switch to the From node, you will find that using show DBS will error, because you have not opened the permission, enter Rs.slaveok (), can be successfully accessed. Switch from node
MONGO localhost:10002
//no permission Query
show DBS
//error
2016-01-06t14:48:53.155+0800 E query [ THREAD1] error:listdatabases failed:{"OK": 0, "errmsg": "Not Master and Slaveok=false", "Code": 13435}:
//Open
gabriel:seconda
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.