GitXplorerGitXplorer
d

mcrouter-hub

public
3 stars
3 forks
0 issues

Commits

List of commits on branch master.
Unverified
c74e3af77ee9246c5f5f49cf81972b715825a823

update README

committed 10 years ago
Unverified
d8a8b579f27c6002a9fdf1325ec26e27e3abe0fb

Better example on curl update config.

committed 10 years ago
Unverified
6c3f2db55cc45324430b543b569ba15bc08511cf

add agent prerequisites on README.

committed 10 years ago
Unverified
71133954fcac8b537ecc8fef2b819c2962afb8c2

Vagrant setup for building linux binary.

committed 10 years ago
Unverified
7a4313d4e0ac64ca0af1861313be10658ca44158

update README.

committed 10 years ago
Unverified
d96d2a6d3acc28b6db099fc975bb09230573f824

Able to perform submissions using tokens.

committed 10 years ago

README

The README file for this repository.

GoDoc license

mcrouter-hub

It's an HTTP companion to Facebook's McRouter.

It allows CRUD operation on McRouter config JSON as well as providing live stats.

Agent Mode

Getting Started

# Prerequisites:
#   * It must be run on the same box where mcrouter is running.
#   * netcat command line tool must be installed.
#
# MCRHUB_CENTRAL_URLS is only useful if you want to have central daemons. That setting is optional.
#
MCROUTER_ADDR=localhost:5000 \
MCROUTER_CONFIG_FILE=./tests/mcrouter.json \
MCRHUB_CENTRAL_URLS=http://localhost:5002 \
/path/to/mcrouter-hub

The agent mode allows mcrouter-hub to collect live information about McRouter. It can also modify the configuration of local McRouter.

While in agent mode, mcrouter-hub has the following required configurations:

  • MCROUTER_ADDR: McRouter host and port address.

  • MCROUTER_CONFIG_FILE: Path to McRouter config file.

Central Mode

Getting Started

MCRHUB_MODE=central \
/path/to/mcrouter-hub

While in central mode, mcrouter-hub can receives configuration or stats data from all mcrouter-hub agents.

Complete Configuration List

  • MCROUTER_ADDR: McRouter host and port address (Required for agent mode).

  • MCROUTER_CONFIG_FILE: Path to McRouter config file (Required for agent mode).

  • MCRHUB_MODE: 2 modes: agent or central. Default: "agent"

  • MCRHUB_READ_ONLY: Read only flag. When true, POST endpoints are disabled. Default: Agent: true, Central: false

  • MCRHUB_LOG_LEVEL: Log level. Default: "info"

  • MCRHUB_ADDR: The HTTP server host and port. Default: Agent: ":5001", Central: ":5002"

  • MCRHUB_CERT_FILE: Path to cert file. Default: ""

  • MCRHUB_KEY_FILE: Path to key file. Default: ""

  • MCRHUB_TOKENS_DIR: Directory of token files. If it is not empty, each line on the file will be treated as one token. These tokens will be used for HTTP POST actions from agent to central. Tokens that exist on both sides are considered valid. Default: ""

    # Token is passed as HTTP user. Example on updating config in agent mode:
    curl -H "Content-Type: application/json" -X POST \
    -d '{"the": "json config"}' \
    -u 0b79bab50daca910b000d4f1a2b675d604257e42: https://localhost:5001/config
    
  • MCRHUB_CENTRAL_URLS: URLs to mcrouter-hub central. mcrouter-hub does not use persistent storage, therefore agents report to one or more central daemons (agent mode only). Default: ""

  • MCRHUB_REPORT_INTERVAL: The frequency of agent reporting (agent mode only). Default: "3s"

  • NR_INSIGHTS_URL: New Relic Insights URL endpoint (agent mode only). Example: https://insights-collector.newrelic.com/v1/accounts/{AccountID}/events. Default: ""

  • NR_INSIGHTS_INSERT_KEY: New Relic Insights insert key (agent mode only). Default: ""