Below is an example of how to setup gnatsd cluster using Docker.
I have put 3 different configurations (one per gnatsd server) under a folder named conf as follows:
tree conf| @echo off | |
| set "pwd=%cd%" | |
| cd ../../.. | |
| SETLOCAL enabledelayedexpansion | |
| for /r %pwd% %%i in (*.proto) do ( | |
| set "str=%%i" | |
| set "str2=!str:%cd%\=!" |
| {"0.9229514588818877":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgME+VxvyamvY5Lmpqv/qYD3sX34CVFXT/EX\r\nZ9UWaoEu9OxVE2sINM86KHzTYs4DXp2o/ngxuaZ3hg2ntTAR4/sXH83/AAAACDxn\r\naXRodWI+wv8AAACOBBATCABA/wAAAAWCWDvBWP8AAAACiwn/AAAACZAm+CikiIbM\r\nEf8AAAAFlQgJCgv/AAAABJYDAQL/AAAAApsD/wAAAAKeAQAA0r0A/iPNGFoL9w80\r\nsefSCOSMaD3kbHbCCBLT3nxzqrw78H1FAQCctezolKqrd23cPfo4VsOLs7FvXfbx\r\nZA595MZlv8Ke3s7/AAAAVgQAAAAAEggqhkjOPQMBBwIDBJ6NF7/rWX3SJcWd6Wrm\r\nAlCMwoc2TL2WpPrc3Ytu83SeYEPqrGcmbU+t7oimDUm041uEtLn6nO85a/GgzA0D\r\nXEwDAQgHwv8AAABtBBgTCAAf/wAAAAWCWDvBWP8AAAAJkCb4KKSIhswR/wAAAAKb\r\nDAAAaUkA/AttqagbTI0/RtiDJ9mwoehY7mGNfSt50GOAloll6ZUXAQCdjL523sGC\r\noqwQdBqURzbSgD9+1ubpY/PQtILOh9cjCQ==\r\n=eOfM\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n","0.6463818907487795":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgME+VxvyamvY5Lmpqv/qYD3sX34CVFXT/EX\r\nZ9UWaoEu9OxVE2sINM86KHzTYs4DXp2o/ngxuaZ3hg2ntTAR4/sXH83/AAAACDxn\r\naXRodWI+wv8AAACOBB |
| # -*- coding: utf-8 -*- | |
| import asyncio | |
| import re | |
| import asyncio_redis | |
| import tornado.concurrent | |
| import tornado.httpclient | |
| import tornado.web | |
| import tornado.platform.asyncio |
| #cloud-config | |
| hostname: node-01 | |
| ssh_authorized_keys: | |
| - ssh-rsa <redacted> | |
| coreos: | |
| etcd2: | |
| discovery: https://discovery.etcd.io/<redacted> | |
| advertise-client-urls: http://node-01.mux.lan:2379 |
| # use with: logging.config.dictConfig(yaml.load(open('logging.yaml', 'r'))) | |
| # Formatters detailed here: http://docs.python.org/2/library/logging.html#logrecord-attributes | |
| version: 1 | |
| formatters: | |
| simple: | |
| format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
| detail: | |
| format: '%(asctime)s - %(levelname)s - File: %(filename)s - %(funcName)s() - Line: %(lineno)d - %(message)s' |
| ''' | |
| This is a module that defines some helper classes and functions for | |
| expiring groups of related keys at the same time. | |
| Written July 1-2, 2013 by Josiah Carlson | |
| Released into the public domain | |
| ''' | |
| import time |
| var GPS = { | |
| PI: 3.14159265358979324, | |
| x_pi: 3.14159265358979324 * 3000.0 / 180.0, | |
| delta: function (lat, lon) { | |
| // Krasovsky 1940 | |
| // | |
| // a = 6378245.0, 1/f = 298.3 | |
| // b = a * (1 - f) | |
| // ee = (a^2 - b^2) / a^2; | |
| var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。 |
| from concurrent.futures import ThreadPoolExecutor | |
| from functools import partial, wraps | |
| import time | |
| import tornado.ioloop | |
| import tornado.web | |
| EXECUTOR = ThreadPoolExecutor(max_workers=4) |