DEPRECATED - Limit restful requests to backend ElasticSearch cluster: Queries only.
Перейти к файлу
Kyle Lahnakoski 1fb5c13fe6 Merge pull request #1 from klahnakoski/remove_util
Remove util
2013-11-14 05:00:00 -08:00
esFrontLine Mark's suggestions 2013-11-12 12:59:46 -05:00
resources/scripts using streams, not sure if actually streaming 2013-09-09 12:13:40 -04:00
.gitignore additions for PyPi 2013-11-12 08:25:05 -05:00
MANIFEST.in Mark's suggestions 2013-11-12 12:59:46 -05:00
README.md fix docs 2013-11-12 08:28:34 -05:00
setup.py additions for PyPi 2013-11-12 08:25:05 -05:00

README.md

esFrontLine

Limit restful requests to backend ElasticSearch cluster: Queries only.

Requirements

  • Python 2.7
  • An ElasticSearch cluster to forward queries to

Install

I will assume you have Python installed (if not, here are Windows7 instructions)

pip install esFrontLine

Setup

You must write your own setting.json file with the following properties set:

  • elasticsearch - (Array of) ElasticSearch nodes

  • elasticsearch.host - URL of the ElasticSearch node that will accept query requests

  • elasticsearch.port - port for ES (default = 9200)

  • flask - flask.run() parameters (default port = 5000)

  • debug - turn on debugging

Here is an example of my settings.json file

{
    "elasticsearch":[{
        "host":"http://elasticsearch4.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch5.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch7.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch8.metrics.scl3.mozilla.com",
        "port":9200
    }],
    "flask":{
        "host":"0.0.0.0",
        "port":9292,
        "debug":false,
        "threaded":true,
        "processes":1
    },
    "debug":{
        "log":[{
            "filename": "./results/logs/app.log",
            "maxBytes": 10000000,
            "backupCount": 200,
            "encoding": "utf8"
        },{
            "stream":"sys.stdout"
        }]
    }

}

Execution

python app.py --settings-file <path_to_file_with_JSON_settings>