Giter VIP home page Giter VIP logo

gke-mongodb-shards-demo's People

Contributors

pkdone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gke-mongodb-shards-demo's Issues

GCE Persistent disks never used

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.

Config server doesn't write to persistent volume

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.

pin mongo to 3.4.10

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?

replica set initiate getting failed with self domain + Mongos Add Shard CONNECT_ERROR

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

"Failed to connect to 127.0.0.1:27017" after the pods are transferred to a new node in GKE

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.