1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-easegress

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
3.06.Service-Registry.md 3.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
su chen Отправлено 20.09.2023 09:38 0722e3b

Service Registry

Easegress servers as a reverse proxy. It can easily integrate with mainstream Service Registries.

Basic: Load Balance

name: pipeline-reverse-proxy
kind: Pipeline
flow:
  - filter: proxy
filters:
  - name: proxy
    kind: Proxy
    pools:
    - servers:
      - url: http://127.0.0.1:9095
      - url: http://127.0.0.1:9096
      - url: http://127.0.0.1:9097
      loadBalance:
        policy: roundRobin

Dynamic: Integration with Service Registry

We integrate Proxy with service registries such as Consul, Etcd, Zookeeper, Eureka. You need to create one of them to connect the external service registry. The service registry config takes higher priority than static servers. If the dynamic servers pulling failed, it will use static servers if there are.

Zookeeper

  1. First we need to create a ZookeeperServiceRegistry in Easegress
kind: ZookeeperServiceRegistry
name: zookeeper-001
zkservices: [127.0.0.1:2181]
prefix: /services
conntimeout: 6s
syncInterval: 10s
  1. Create a pipeline and set its serviceRegistry field into zookeeper-001 and it will look up the zookeeper configuration for the service named springboot-application-order as in field serviceName.
name: pipeline-reverse-proxy
kind: Pipeline
flow:
  - filter: proxy
filters:
  - name: proxy
    kind: Proxy
    pools:
    - servers:
      - url: http://127.0.0.1:9095
      - url: http://127.0.0.1:9096
      - url: http://127.0.0.1:9097
      serviceRegistry: zookeeper-001              # +
      serviceName: springboot-application-order   # +
      loadBalance:
        policy: roundRobin

Consul

  1. First we need to create a ConsulServiceRegistry in Easegress
kind: ConsulServiceRegistry
name: consul-001
address: '127.0.0.1:8500'
scheme: http
syncInterval: 10s
  1. Create a pipeline and set its serviceRegistry field into consul-001 and it will look up the consul configuration for the service named springboot-application-order as in field serviceName.
name: pipeline-reverse-proxy
kind: Pipeline
flow:
  - filter: proxy
filters:
  - name: proxy
    kind: Proxy
    pools:
    - servers:
      - url: http://127.0.0.1:9095
      - url: http://127.0.0.1:9096
      - url: http://127.0.0.1:9097
      serviceRegistry: consul-001              # +
      serviceName: springboot-application-order   # +
      loadBalance:
        policy: roundRobin

Eureka

  1. First we need to create a EurekaServiceRegistry in Easegress
kind: EurekaServiceRegistry
name: eureka-001
endpoints: ['http://127.0.0.1:8761/eureka']
syncInterval: 10s
  1. Create a pipeline and set its serviceRegistry field into eureka-001 and it will look up the eureka configuration for the service named springboot-application-order as in field serviceName.
name: pipeline-reverse-proxy
kind: Pipeline
flow:
  - filter: proxy
filters:
  - name: proxy
    kind: Proxy
    pools:
    - servers:
      - url: http://127.0.0.1:9095
      - url: http://127.0.0.1:9096
      - url: http://127.0.0.1:9097
      serviceRegistry: eureka-001              # +
      serviceName: springboot-application-order   # +
      loadBalance:
        policy: roundRobin

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-easegress.git
git@api.gitlife.ru:oschina-mirror/mirrors-easegress.git
oschina-mirror
mirrors-easegress
mirrors-easegress
main