replicaset

How to stop Replicaset from restarting?

限于喜欢 提交于 2019-12-02 02:33:27
I started a test if my kubernetes installation is running well, with: $ kubectl run -it hello --image=busybox -- sh However it didn't work. Now I want to just clean up everything before I figure out how to continue. But if I delete the pod it gets restarted, I suppose by a corresponding replicaset. But this gets restarted as well if I delete it . What can I do now to clean up whatever kubectl run did? The run command creates a deployment which controls the replicaset please run the following commands to verify and solve: kubectl get deployments kubectl delete deployment hello 来源: https:/

How to stop Replicaset from restarting?

戏子无情 提交于 2019-12-02 02:27:31
问题 I started a test if my kubernetes installation is running well, with: $ kubectl run -it hello --image=busybox -- sh However it didn't work. Now I want to just clean up everything before I figure out how to continue. But if I delete the pod it gets restarted, I suppose by a corresponding replicaset. But this gets restarted as well if I delete it . What can I do now to clean up whatever kubectl run did? 回答1: The run command creates a deployment which controls the replicaset please run the

MongoEngine specify read preference on query

隐身守侯 提交于 2019-12-02 01:53:25
I am using Mongo 2.6, Pymongo 2.7.2 and Mongoengine 0.8.7. For a particular read query, I want to use the secondary of my replica set. Hence, as specified in the mongoengine documentation here I wrote my query as follows : from pymongo.read_preferences import ReadPreference <collection_name>.objects().read_preference(ReadPreference.SECONDARY_PREFERRED) However, the query is always going to the primary it seems ( The logs for this query are always seen only in the primary ). Is the syntax correct? If yes, how do I verify if the secondary is being queried? Figured out what the issue was. In the

“This node was not started with the replSet option”

北城以北 提交于 2019-12-02 01:30:27
I am studying the MongoDBUniversity 's M101P: MongoDB for Developers course. I am using WiredTiger on MongoDB 3.2 . I am currently on the topic of replica sets . The course requires I create a replica set using the following code: mongod --replSet rs1 --logpath "1.log" --dbpath /data/rs1 --port 27017 --fork But I am using Windows, which doesn't support fork , so using this gist (as recommended by a course admin) I ran these lines simultaneously in 3 different consoles after I had created the directories (with mongod running): mongod --replSet rs1 --logpath "1.log" --dbpath rs1 --port 27018 -

Number of active connections on the server reached to max

故事扮演 提交于 2019-12-01 05:12:29
I am working with mongodb and nodejs. I have mongodb hosted on Atlas. My backend had been working perfectly but now it is sometimes getting stuck and when I see the analytics on mongodb atlas it shows maximum number of active connections reached to 100 . Can someone please explain why this is happening? Can I reboot the connections and make it 0 ? @Stennie I have used mongoose to connect to database Here is my configuration file const mongooseOptions = { useNewUrlParser: true, autoReconnect: true, poolSize: 25, connectTimeoutMS: 30000, socketTimeoutMS: 30000 } exports.register = (server,

Number of active connections on the server reached to max

情到浓时终转凉″ 提交于 2019-12-01 02:54:26
问题 I am working with mongodb and nodejs. I have mongodb hosted on Atlas. My backend had been working perfectly but now it is sometimes getting stuck and when I see the analytics on mongodb atlas it shows maximum number of active connections reached to 100 . Can someone please explain why this is happening? Can I reboot the connections and make it 0 ? @Stennie I have used mongoose to connect to database Here is my configuration file const mongooseOptions = { useNewUrlParser: true, autoReconnect:

MongoDB ReplicaSet - PRIMARY role falls to SECONDARY when only PRIMARY is left

痞子三分冷 提交于 2019-11-30 16:12:19
I am investigating using MongoDB ReplicaSet for high availability. But just discovered that in ReplicaSet with 3 nodes, if PRIMARY mongod is the only one left (that is 2 other mongod instances died or were shut down), then after several seconds it switches role to SECONDARY and accepts writes no more. That makes Replica Set worth less than single instance. I know & understand about PRIMARY election, but the PRIMARY role is fixed to a server (by using priority set to ,say, 10) and (for example due to network problems) other servers become inaccessible, why the main server just gives up?! Tested

Mongoose connection to replica set

戏子无情 提交于 2019-11-30 07:13:20
I tried to connect to MongoDB replicaSet via mongoose. I used this link . Configuration json: "mongoose": { "uri": "mongodb://localhost:27022/chat,localhost:27021,localhost:27020", "options": { "replset": { "rs_name": "rs0" }, "server": { "poolSize": 3, "socketOptions": { "keepAlive": 1 } } } } Mongoose connect: var mongoose = require('mongoose'); mongoose.connect(config.get('mongoose:uri'), config.get('mongoose:options')); And after launching application i got exception: Error: host must be specified [undefined] at new exports.ConnectionPool (c:\Users\lor1an\Downloads\prj_chat-master\prj_chat

How to convert a MongoDB replica set to a stand alone server

回眸只為那壹抹淺笑 提交于 2019-11-30 02:55:25
Consider, I have 4 replicate sets and the config is as follows: { "_id": "rs_0", "version": 5, "members" : [ {"_id": 1, "host": "127.0.0.1:27001"}, {"_id": 2, "host": "127.0.0.1:27002"}, {"_id": 3, "host": "127.0.0.1:27003"}, {"_id": 4, "host": "127.0.0.1:27004"} ] } I am able to connect to all sets using mongo --port <port> There are documents for getting information on Convert a Standalone to a Replica Set , but can anyone tell me how to convert back to standalone from replica set? Just remove a host from replica set ( rs.remove('host:port') ), relaunch it without replSet parameter and it's

Mongoose connection to replica set

纵饮孤独 提交于 2019-11-29 09:26:32
问题 I tried to connect to MongoDB replicaSet via mongoose. I used this link. Configuration json: "mongoose": { "uri": "mongodb://localhost:27022/chat,localhost:27021,localhost:27020", "options": { "replset": { "rs_name": "rs0" }, "server": { "poolSize": 3, "socketOptions": { "keepAlive": 1 } } } } Mongoose connect: var mongoose = require('mongoose'); mongoose.connect(config.get('mongoose:uri'), config.get('mongoose:options')); And after launching application i got exception: Error: host must be