Coder Social home page Coder Social logo

gorouter's Introduction

gorouter

从CloudFoundry gorouter(tag 45ca951297) fork,更改实现。

主要修改点: CloudFoundry gorouter通过侦听NATS汇报的信息生成路由表; 而现在gorouter去redis里读取相应信息生成路由表(gorouter会在内存中保存份路由表,如果redis宕掉将暂停更新路由表)。

router启动时,从redis中加载路由表(URL与rs_ip:port的对应关系,以及CNAME与URL的对应关系),格式如

redis 127.0.0.1:6379> keys *
1) "/rs/demo.xae.xiaomi.com"
3) "/rs/test.xae.xiaomi.com"
4) "/cname/ulricqin.com"
6) "/rs/api2.xae.xiaomi.com"
redis 127.0.0.1:6379> lrange /rs/demo.xae.xiaomi.com 0 -1
1) "10.201.37.5:10005"
2) "10.201.37.5:10004"
redis 127.0.0.1:6379> get /cname/ulricqin.com
"/rs/demo.xae.xiaomi.com"

每隔reload_uri_interval(单位s,默认5s),从redis重新加载路由表

配置项说明

  • redis_server: DINP server模块的redis server地址
  • reload_uri_interval: 更新路由表的周期,单位s (默认5s) 其它配置项与安装同CloudFoundry gorouter。

gorouter's People

Contributors

pietern avatar bluesalt avatar vito avatar emalm avatar julz avatar luan avatar d avatar matthewmcnew avatar sykesm avatar jfmyers9 avatar mark-rushakoff avatar liuhewei avatar zrob avatar jackfengibm avatar cf-frameworks avatar mreider avatar sujoybasu avatar oppegard avatar sandipchitale avatar rogerluo410 avatar phanle avatar mavenraven avatar aramprice avatar dengwa avatar thansmann avatar tammersaleh avatar tissarah avatar ruthie avatar filirom1 avatar youngm avatar

Watchers

James Cloos 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.