Code Monkey home page Code Monkey logo

k8s-replicaset-mongodb-loadbalance's Introduction

This read Me for setting up replica set for mongo krub

1. Install kubernete

2. Install Metallb system

3 Run file .yaml

$ kubectl create -f .

4.connect mongo pod together

Set primary node

$ kubectl exec -it mongo-0.mongo:27017
> rs.initiate()
> var ctx = rs.conf()
> ctx.members[0].host="mongo-0.mongo:27017"

re-save config

> rs.reconfig(ctx)

connect rest node to primary node :3

> rs.add("mongo-1.mongo:27017")
> rs.add("mongi-2.mongo:27017")

check it with creeate new mongo shell pod

$ mongo mongodb://mongo-0.mongo,mongo-1.mongo,mongo-2.mongo

and check with

> rs.status()

Sirawich Voungchuy :3

k8s-replicaset-mongodb-loadbalance's People

Contributors

sirawichdev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.