Giter Club home page Giter Club logo

server's Introduction

Server

这是整个系统最核心的模块了,主要有以下功能

    1. 开一个rpc端口,接收Agent的心跳信息,收集所有计算节点的负载和container列表,存入内存,称之为real state
    1. 开一个http端口用于调试,暴露内存信息
    1. 连接Dashboard的DB,定期获取当前app的目标状态,称之为desired state
    1. 比较real state和desired state,如果container挂了,或者扩容了,就可以比较得知差异,然后创建新的container或者销毁多余的container
    1. 分析Agent上报的container列表,组织出路由信息,写入redis
    1. 把配置的scribe连接地址通过环境变量写入container,container中的app就可以把log推到这个scribe服务器

问题

如果server挂了怎么办?

Agent配置了两个server的地址,平时只启动一个server,如果server所在机器挂了,去启动另一个即可,Agent会自动重连。此处可以做一个自动选主之类的逻辑,太麻烦,没做

如果存放路由信息的redis挂了怎么办?

router每次从redis获取了路由之后会缓存到本地内存,redis挂了问题不大,只是不能感知后端container变化了。

其实,即使dinp的大部分组件都挂了,只要router没挂,container没挂,已有的服务都不会受影响,只是没法上线、扩容了

server's People

Contributors

ulricqin avatar

Watchers

 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.