pkdone / gke-mongodb-shards-demo Goto Github PK
View Code? Open in Web Editor NEWMongoDB Sharded Cluster Deployment Demo for Kubernetes on GKE
License: MIT License
MongoDB Sharded Cluster Deployment Demo for Kubernetes on GKE
License: MIT License
Hi,
it seems the created pd is never used.
gcloud compute disks create --size 8GB --type pd-ssd pd-ssd-disk-8g-$i
this creates a persistent disk, however, later when creating persistentVolumeClaim and pod requesting a persistent volume, it creates its own persistentVolume with autogenerated name and the former pd just hangs there.
I believe the point was to have a persistentVolume (to not lose the data) which will be named like pd-ssd-disk-8g-$i
and that doesn't work.
I may submit a PR if you want. Just tell me if you prefer naming the pds as intented or its not important and we can just delete the loops with pd creations.
Thanks for the repo and blog btw! It was really helpful.
Getting following error , after gcloud cluster and disk creation.
x509: certificate signed by unknown authority
Config server writes to /data/configdb I believe rather than /data/db.
This means that when a full restart of the cluster or things get shuffled around the config servers data is lost and a recovery is needed.
Hi again :)
Yesterday/today they changed the latest tag on mongo docker image from 3.4 -> 3.6
docker-library/official-images@9ab6d58#diff-c7d492b78482cdbec624f40bb1b722fd
that breaks quite a lot of things, 3.6 seems not to have --bind_ip_all
by default and sh.addShard yields this error
mongos> sh.addShard("Shard4RepSet/mongod-shard4-0.mongodb-shard4-service.default.svc.cluster.local:27017");
{
"code" : 96,
"ok" : 0,
"errmsg" : "can't add shard 'Shard4RepSet/mongod-shard4-0.mongodb-shard4-service.default.svc.cluster.local:27017' because a local database 'config' exists in another config"
}
I'd recommend pinning the mongo docker image - mongo:latest -> mongo:3.4.10
What do you think?
I am getting error while initiating a replicaset. Here, i am trying to setup standalone (only one member) replicaset.
rs.initiate({_id: "Shard1RepSet", version: 1, members: [ {_id: 0, host: "mongodb-shard1-0.mongodb-shard1-service:27017"} ]}) { "ok" : 0, "errmsg" : "couldn't initiate : can't find self in the replset config" }
Instead of this if i do rs.initiate()
it assign perfectly and make it PRIMARY.
Then after this init, proceeding to adding shard from mongos, it throws following
sh.addShard("Shard1RepSet/mongodb-shard1-0.mongodb-shard1-headless-service:27017") { "ok" : 0, "errmsg" : "couldn't connect to new shard socket exception [CONNECT_ERROR] for Shard1RepSet/mongodb-shard1-0.mongodb-shard1-headless-service:27017" }
I thought of network issue, then from same mongos container i did tried to connect to replicaset member its connecting perfectly. Can you help me with this? what could be possible reason? I am running mongo:2.6
root@mongos-567bcbb45d-lx47x:/# mongo --host mongodb-shard1-0.mongodb-shard1-headless-service --port 27017
Hi Paul,
The gke-mongodb-shards-demo is great, and I had applied it in my GKE, thank you very much.
Now I added a new node in kubernetes, and transferred all pods (including the mongodb shards pods) to it via labeled the old node as taint. After that, I found that my app can not connect to this mongodb shards.
kubectl logs mongos-router-0 -n mongodb
2018-05-15T08:53:51.757+0000 I NETWORK [shard registry reload] Successfully connected to mongod-configdb-1.mongodb-configdb-service.mongodb.svc.cluster.local:27017 (1 connections now open to mongod-configdb-1.mongodb-configdb-service.mongodb.svc.cluster.local:27017 with a 5 second timeout)
2018-05-15T08:53:51.851+0000 I NETWORK [initandlisten] Successfully connected to mongod-configdb-0.mongodb-configdb-service.mongodb.svc.cluster.local:27017 (1 connections now open to mongod-configdb-0.mongodb-configdb-service.mongodb.svc.cluster.local:27017 with a 5 second timeout)
2018-05-15T08:53:51.851+0000 W NETWORK [initandlisten] Unable to reach primary for set ConfigDBRepSet
2018-05-15T08:53:51.851+0000 I NETWORK [initandlisten] Cannot reach any nodes for set ConfigDBRepSet. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
When I re-generate the mongodb shards, the following error occured repeatedly :
Waiting for all the shards and configdb containers to come up (Tue May 15 17:16:58 CST 2018)...
(IGNORE any reported not found & connection errors)
connection to 127.0.0.1:27017
2018-05-15T09:17:35.750+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-05-15T09:17:35.750+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:21
exception: connect failed
command terminated with exit code 1
What should I do ?
Thanks a lot.
Best,
Owen
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.