Skip to content

Commit

Permalink
Merge branch 'release/v3.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
royrusso committed Jul 26, 2018
2 parents f427f9f + a24f722 commit e7ee485
Show file tree
Hide file tree
Showing 32 changed files with 444 additions and 216 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache bash \
# reqs layer
ADD requirements.txt .
RUN pip3 install -U -r requirements.txt
RUN pip3 install gunicorn
RUN pip3 install gunicorn==19.7.1

# Bundle app source
ADD . /src
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ For **full** installation and configuration instructions, see [Getting Started](

1. Download or clone the repository.
2. Open terminal and point to root of repository. Type: ``pip install -r requirements.txt``
3. Run server with: `` python application.py ``. Alternatively: ``./manage.py runserver``
3. Run server with: `` python3 application.py ``. Alternatively: ``./manage.py runserver``
4. Access HQ with: `` http://localhost:5000 ``

For further installation and configuration help, please read the docs: [ElasticHQ Documentation](http://docs.elastichq.org)
Expand Down
4 changes: 3 additions & 1 deletion deployment/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ nodaemon=true

[program:gunicorn]
command=/usr/local/bin/gunicorn application:application -w 1 --worker-class eventlet --config /src/gunicorn.conf --log-config /src/logging.conf --bind 0.0.0.0:5000
directory=/src
directory=/src
stdout_logfile=/var/log/supervisor/stdout.log
stderr_logfile=/var/log/supervisor/stderr.log
Binary file modified docs/.doctrees/developer-guide.doctree
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/faq.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/.doctrees/rest-api.doctree
Binary file not shown.
Binary file modified docs/.doctrees/table-with-code.doctree
Binary file not shown.
Binary file modified docs/.doctrees/user-guide.doctree
Binary file not shown.
89 changes: 79 additions & 10 deletions docs/_sources/installation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Install ElasticHQ

1. Download or clone the repository https://github.com/ElasticHQ/elasticsearch-HQ
2. Navigate to the root of the repository: ``pip install -r requirements.txt``
3. Start the server: ``python application.py``
3. Start the server: ``python3 application.py``
4. Point your browser to: http://localhost:5000

.. note:: Alternatively, you can start the server with ``python manage.py runserver``
Expand Down Expand Up @@ -76,14 +76,16 @@ Command line Parameters

The ``application.py`` start script takes parameters passed in as arguments from the command line:

=========== ========================= ====================================================================
Arg Default Value Definition
=========== ========================= ====================================================================
``--host`` 127.0.0.1 Host the HQ server should be reachable on.
``--port`` 5000 Port to reach HQ server.
``--debug`` False If True, exposes debug data to UI and causes reload on code changes.
``--url`` ``http://localhost:9200`` Default URL displayed on the initial connection screen.
=========== ========================= ====================================================================
================ ========================= ====================================================================
Arg Default Value Definition
================ ========================= ====================================================================
``--host`` 127.0.0.1 Host the HQ server should be reachable on.
``--port`` 5000 Port to reach HQ server.
``--debug`` False If True, exposes debug data to UI and causes reload on code changes.
``--url`` ``http://localhost:9200`` Default URL displayed on the initial connection screen.
``--enable-ssl`` False If flag is passed, assumes ssl cert will be used.
``--ca-certs`` /path/to/your/ca.crt Path to your CA Certificate. Required if enable-ssl is passed.
================ ========================= ====================================================================

.. _environment variables:

Expand All @@ -94,6 +96,8 @@ Environment Variables
Arg Default Value Definition
================== ========================= ====================================================================
``HQ_DEFAULT_URL`` ``http://localhost:9200`` Default URL displayed on the initial connection screen.
``HQ_ENABLE_SSL`` False If flag is passed, assumes ssl cert will be used.
``HQ_CA_CERTS`` /path/to/your/ca.crt Path to your CA Certificate. Required if enable-ssl is passed.
================== ========================= ====================================================================


Expand All @@ -106,13 +110,52 @@ Advanced users that want to have control over the logging output, can adjust it

Docker users will find the logfile location under ``/src/application.log``

Connecting with SSL
^^^^^^^^^^^^^^^^^^^

Thanks to a community contribution, SSL Cert support has been added: `SSL Support <https://github.com/ElasticHQ/elasticsearch-HQ/issues/376>`_.

Enable SSL Cert support by starting HQ as so:

``python -m application --enable-ssl --ca-certs /path/to/your/ca.crt``


Database
^^^^^^^^

ElasticHQ ships with SQLLite integration to store clusters you have connected to and other meta information. This database is kept under the root directory as ``elastichq.db``.

.. note:: In the event you want to start with a clean slate, simply delete the ``elastichq.db`` file. ElasticHQ will recreate it at next startup.

External Configuration
^^^^^^^^^^^^^^^^^^^^^^

External configuration files are supported for those wanting to preserve their user-specified settings between upgrades.

On startup, HQ checks the following locations for a file named ``settings.json``:

* `/etc/elastic-hq/settings.json`
* `~/settings.json`
* CURRENT WORKING DIRECTORY + ``/settings.json``
* CURRENT WORKING DIRECTORY + ``/elastichq/settings.json``
* CURRENT WORKING DIRECTORY + ``/config/settings.json``

Current supported parameters are:

=========================== ====================================================================
Key Definition
=========================== ====================================================================
``SQLALCHEMY_DATABASE_URI`` Location and Name of ElasticHQ database file.
=========================== ====================================================================

The settings file should be in standard JSON:

.. code-block:: json

{
"SQLALCHEMY_DATABASE_URI" : "sqlite:////SOME/PATH/TO/DB_NAME.db"
}

Upgrading
---------

Expand Down Expand Up @@ -184,7 +227,7 @@ Failure in connecting initially to an Elasticsearch cluster, can happen for seve
.. _xpack integration:

X-Pack Integration
~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^

X-Pack is configured with authentication. To connect, you must pass along the username and password in the connection URL
using the format ``http://USERNAME:PASSWORD@DOMAIN:PORT``
Expand All @@ -201,6 +244,32 @@ In the base installation, the logs are available under the ``/install/path/appli

For docker images, the application logging can be found under ``/src/application.log``.

.. _ssl_trouble:

SSL Cert not working
^^^^^^^^^^^^^^^^^^^^

**NOTE: Your CA file must be the same signer of your Elasticsearch node, for HQ to connect as a trusted source.**

Verify that the certificate works by connecting directly from the HQ instance to the ES node in question, using the cert:

``curl -u admin:password --ca-certs /path/to/ca.crt https://localhost:9200/_cluster/settings?pretty``

Preserving Database across Docker container restarts
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following code block originated as an issue (https://github.com/ElasticHQ/elasticsearch-HQ/issues/409) for those wanting to preserve the HQ SQLLite DB between container restarts.

.. code-block:: bash

docker run --detach
--restart=always
--net host
--volume elastichq:/src/db
--name elastichq
elastichq/elasticsearch-hq
sh -x -c 'sed -i -r -e "s/_sqlalchemy_database_uri =.*/_sqlalchemy_database_uri = "sqlite:///" + os.path.join(BASEPATH, "db" , "elastichq.db")/" /src/elastichq/config/settings.py && exec supervisord -c /etc/supervisor/supervisord.conf'

License
-------

Expand Down
Loading

0 comments on commit e7ee485

Please sign in to comment.