• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    Go
  • License
    Other
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

influxdb HA

InfluxDB Proxy

This project adds a basic high availability layer to InfluxDB.

NOTE: influx-proxy must be built with Go 1.7+, don't implement udp.

Why

We used InfluxDB Relay before, but it doesn't support some demands. We use grafana for visualizing time series data, so we need add datasource for grafana. We need change the datasource config when influxdb is down. We need transfer data across idc, but Relay doesn't support gzip. It's inconvenient to analyse data with connecting different influxdb. Therefore, we made InfluxDB Proxy.

Features

  • Support gzip.
  • Support query.
  • Filter some dangerous influxql.
  • Transparent for client, like cluster for client.
  • Cache data to file when write failed, then rewrite.

Requirements

  • Golang >= 1.7

Usage

$ # Install influx-proxy to your $GOPATH/bin
$ go get -u github.com/wilhelmguo/influx-proxy/service
$ go install github.com/wilhelmguo/influx-proxy/service
$ mv $GOPATH/bin/service $GOPATH/bin/influx-proxy
$ # Start influx-proxy!
$ $GOPATH/bin/influx-proxy -config proxy.json

Description

The architecture is fairly simple, one InfluxDB Proxy process and two or more InfluxDB processes. The Proxy should point HTTP requests with measurements to the two InfluxDB servers.

The setup should look like this:

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚writes & queries โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚
                 โ–ผ
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚               โ”‚
         โ”‚InfluxDB Proxy โ”‚
         |  (only http)  |
         โ”‚               โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚
                 โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚   measurements  โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          |              |
        โ”Œโ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚          โ”‚      โ”‚          โ”‚
  โ”‚ InfluxDB โ”‚      โ”‚ InfluxDB โ”‚
  โ”‚          โ”‚      โ”‚          โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

measurements match principle:

  • Exact match first. For instance, we use cpu.load for measurement's name. The KEYMAPS has cpu and cpu.load keys. It will use the cpu.load corresponding backends.

  • Then Prefix match. For instance, we use cpu.load for measurement's name. The KEYMAPS only has cpu key. It will use the cpu corresponding backends.

Query Commands

Unsupported commands

The following commands are forbid.

  • GRANT
  • REVOKE

Supported commands

Only support match the following commands.

  • .*from.*
  • drop measurement.*
  • show.*measurements

License

MIT.

More Repositories

1

RePlugin

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Java
7,261
star
2

Atlas

A high-performance and stableย proxy for MySQL, it is developed by Qihoo's DBA and infrastructure team
C
4,650
star
3

wayne

Kubernetes multi-cluster management and publishing platform
TypeScript
3,706
star
4

evpp

A modern C++ network library for developing high performance network services in TCP/UDP/HTTP protocols.
C++
3,564
star
5

ArgusAPM

Powerful, comprehensive (Android) application performance management platform. 360็บฟไธŠ็งปๅŠจๆ€ง่ƒฝๆฃ€ๆต‹ๅนณๅฐ
Java
2,673
star
6

safe-rules

่ฏฆ็ป†็š„C/C++็ผ–็จ‹่ง„่ŒƒๆŒ‡ๅ—๏ผŒ็”ฑ360่ดจ้‡ๅทฅ็จ‹้ƒจ็ผ–่‘—๏ผŒ้€‚็”จไบŽๆกŒ้ขใ€ๆœๅŠก็ซฏๅŠๅตŒๅ…ฅๅผ่ฝฏไปถ็ณป็ปŸใ€‚
2,363
star
7

Quicksql

A Flexible, Fast, Federated(3F) SQL Analysis Middleware for Multiple Data Sources
Java
2,057
star
8

poseidon

A search engine which can hold 100 trillion lines of log data.
Go
1,966
star
9

QConf

Qihoo Distributed Configuration Management System
C++
1,865
star
10

hbox

AI on Hadoop
Java
1,727
star
11

phptrace

A tracing and troubleshooting tool for PHP scripts.
C
1,677
star
12

mysql-sniffer

mysql-sniffer is a network traffic analyzer tool for mysql, it is developed by Qihoo DBA and infrastructure team
C
845
star
13

huststore

High-performance Distributed Storage
C
823
star
14

doraemon

Doraemon is a Prometheus based monitor system
JavaScript
655
star
15

logkafka

Collect logs and send lines to Apache Kafka
C++
500
star
16

zeppelin

A Scalable, High-Performance Distributed Key-Value Platform
C++
399
star
17

tensornet

C++
316
star
18

qbusbridge

The Apache Kafka Client SDK
C++
292
star
19

360zhinao

360zhinao
Python
274
star
20

XSQL

Unified SQL Analytics Engine Based on SparkSQL
Scala
210
star
21

WatchAD2.0

WatchAD2.0ๆ˜ฏไธ€ๆฌพ้’ˆๅฏนๅŸŸๅจ่ƒ็š„ๆ—ฅๅฟ—ๅˆ†ๆžไธŽ็›‘ๆŽง็ณป็ปŸ
CSS
206
star
22

zendAPI

The C++ wrapper of zend engine
C++
183
star
23

mongosync

mongosync is simple && useful tool to sync data between mongo replicaSet, it is developed by Qihoo's DBA and infrastructure team
C++
154
star
24

artdumper

ไปŽoatๆ–‡ไปถไธญdumpๅ‡บๆฅdex็š„ๅทฅๅ…ท
C++
138
star
25

kmemcache

linux kernel memcache server
C
126
star
26

XLearning-XDML

extremely distributed machine learning
Scala
123
star
27

simcc

A simple C++ common base library used in Qihoo 360
C++
116
star
28

nemo

A library that provide multiply data structure. Such as map, hash, list, set. We build these data structure base on rocksdb as the storage layer for Pika https://github.com/OpenAtomFoundation/pika .
C++
115
star
29

ngx_http_subrange_module

Split one big HTTP/Range request to multiple subrange requesets
C
107
star
30

blackwidow

A library implements REDIS commands(Strings, Hashes, Lists, Sorted Sets, Sets, Keys, HyperLogLog) based on rocksdb, as the storage layer for Pika https://github.com/OpenAtomFoundation/pika .
C++
99
star
31

QNAT

C
88
star
32

Mario

A Library that make the write from synchronous to asynchronous.
C++
78
star
33

Luwak

ๅˆฉ็”จ้ข„่ฎญ็ปƒ่ฏญ่จ€ๆจกๅž‹ไปŽ้ž็ป“ๆž„ๅŒ–ๅจ่ƒๆŠฅๅ‘Šไธญๆๅ– MITRE ATT&CK TTP ไฟกๆฏ
Python
68
star
34

mpic

A C++ embedded library of multiple processes framework developed and used at Qihoo360.
C++
50
star
35

nemo-rocksdb

Add TTL feature on rocksdb, and compatible with rocksdb
C++
44
star
36

dgl-operator

Theย DGLย Operatorย makesย itย easyย toย runย Deepย Graphย Libraryย (DGL)ย graphย neuralย networkย trainingย onย Kubernetes
Go
44
star
37

ironwill

Useful iOS components for your project. ๅฅๅฃฎไธ”ๆœ‰็”จ็š„OCไปฃ็ , ๅฏไปฅ็›ดๆŽฅๅœจไฝ ็š„iOSๅบ”็”จไธญไฝฟ็”จ.
Objective-C
37
star
38

elog

A erlang log nif
C++
28
star
39

rust-jsonnet

rust-jsonnet - The Google Jsonnet( operation data template language) for rust
Rust
24
star
40

zeppelin-gateway

Object Gateway Provide Applications with a RESTful Gateway to zeppelin
C++
23
star
41

zeppelin-client

Client Library for zeppelin
C++
21
star
42

luajit-jsonnet

The Google Jsonnet( operation data template language) for Luajit
C++
16
star
43

HTTPSLayer

PHP
16
star
44

CReSS

Cross-model Retrieval between 13C NMR Spectrum and Structure
Python
15
star
45

wayne-backend-plugins

Wayne backend plugins
Go
13
star
46

gpstall

Stall Postgres' insert command
C++
8
star
47

cloud-website

360 cloud official website
PHP
8
star
48

wayne-frontend-plugins

Wayne UI Plugins
TypeScript
7
star
49

SEEChat

ไธ€่งๅคšๆจกๆ€ๅฏน่ฏๆจกๅž‹
Python
5
star
50

wiki

wiki for qihoo infrastructure team
2
star
51

se-office

se-officeๆ‰ฉๅฑ•๏ผŒๆไพ›ๅŸบไบŽๅผ€ๆ”พๆ ‡ๅ‡†็š„ๅ…จๅŠŸ่ƒฝๅŠžๅ…ฌ็”ŸไบงๅŠ›ๅฅ—ไปถ๏ผŒๅŸบไบŽๆต่งˆๅ™จ้ข„่งˆๅ’Œ็ผ–่พ‘officeใ€‚
JavaScript
1
star