Service Network

The micro network service is a multi-cloud service networking solution

The micro network service is a multi-cloud service networking solution which works across public and private environments.

Service Network - 图1

Overview

The micro network provides multi-cloud capability and builds a large scale flat network over which all services can communicate with each other. It makes use of our proxy, router, tunnel and network packages in go-micro to produce global routing across any environment.

The network generates a routing table based on the local service registry and shares this amongst nodes. It builds in a router and proxy so any request made to any network node can be routed across the global network. It prioritises local routing first and can range up to 3 hops in a chain if needed.

Run Network

Start the network seed node (Runs on port :8085)

  1. micro network

Start the next nodes in a different environment connecting to the first (assuming its running at 10.0.0.1:8085)

  1. micro network --nodes=10.0.0.1:8085

Network Services

You may now list the nodes, routes, services and graph

  1. # list the nodes
  2. micro network nodes
  3. # list the routes
  4. micro network routes
  5. # list the services
  6. micro network services
  7. # print the graph
  8. micro network graph

Any request now made through the network will be proxied to a service on the other side.

Set your proxy to use the network

  1. MICRO_PROXY=go.micro.network go run main.go

Your service will direct all traffic through the network.

Authentication

Specify a network token to limit access to the network.

  1. MICRO_NETWORK_TOKEN=foobar micro network

Nodes must provide a valid and matching token to join the network. The default token is “go.micro.tunnel” which allows any node to join and communicate between them.