Web administration for Elasticsearch

Table of contents

Disclaimer

(Back to table of contents)

The application named elasticsearch-admin is NOT affiliated in any way with Elasticsearch BV.

Elasticsearch is a trademark of Elasticsearch BV, registered in the U.S. and in other countries.

Features

(Back to table of contents)

Screenshots

(Back to table of contents)

Selection

(Back to screenshots)

Cluster

Cluster audit

Cluster allocation explain

Nodes

Indices

Index import from database

Shards

Snaphosts

Notifications

All screenshots

(Back to screenshots)

Installation

(Back to table of contents)

Running with Docker

(Back to installation)

Requirements

(Back to running with Docker)

Steps

(Back to running with Docker)

The Docker image is hosted on Docker Hub Visit

docker pull stephanediondev/elasticsearch-admin

docker run -e "ELASTICSEARCH_URL=http://x.x.x.x:9200" -e "SECRET_REGISTER=xxxxx" -p 80:8080 -p 443:4443 -d --name elasticsearch-admin stephanediondev/elasticsearch-admin

Edit ELASTICSEARCH_URL and SECRET_REGISTER (random string to secure registration)

If Elasticsearch security features are enabled, add -e "ELASTICSEARCH_USERNAME=xxxxx" -e "ELASTICSEARCH_PASSWORD=xxxxx"

If you have SSL certificates, add -v /path/privkey.pem:/etc/nginx/privkey.pem -v /path/fullchain.pem:/etc/nginx/fullchain.pem

Source installation

(Back to installation)

Requirements

(Back to source installation)

Web server

(Back to source installation)

Configure a vhost with the document root set to the public folder (ie /var/www/elasticsearch-admin/public)

Apache

(Back to web server)

Add the vhost below

<VirtualHost *:80>
    DocumentRoot "/var/www/elasticsearch-admin/public"
    ServerName your-domain-or-sub-domain
    ErrorLog ${APACHE_LOG_DIR}/elasticsearch-admin-error.log
    CustomLog ${APACHE_LOG_DIR}/elasticsearch-admin-access.log combined

    <Directory /var/www/elasticsearch-admin/public>
        AllowOverride None

        DirectoryIndex index.php

        <IfModule mod_negotiation.c>
            Options -MultiViews
        </IfModule>

        <IfModule mod_rewrite.c>
            RewriteEngine On

            RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
            RewriteRule .* - [E=BASE:%1]

            RewriteCond %{HTTP:Authorization} .+
            RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]

            RewriteCond %{ENV:REDIRECT_STATUS} =""
            RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ %{ENV:BASE}/index.php [L]
        </IfModule>

        <IfModule !mod_rewrite.c>
            <IfModule mod_alias.c>
                RedirectMatch 307 ^/$ /index.php/
            </IfModule>
        </IfModule>
    </Directory>
</VirtualHost>

If you can’t edit a vhost, add the Apache pack to get the .htaccess file in the public folder

composer require symfony/apache-pack

nginx

Add the server definition below

(Back to web server)

server {
    listen [::]:8080 default_server;
    listen 8080 default_server;
    server_name your-domain-or-sub-domain;

    sendfile off;

    root /var/www/elasticsearch-admin/public;
    index index.php index.html;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        internal;
    }

    location ~ \.php$ {
        return 404;
    }
}

Steps

(Back to source installation)

Download or clone the repository from GitHub Visit

If you don’t have PHP 7.4, remove composer.lock or you will have the error below

Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is ...

Launch the following commands to install

cd /var/www/elasticsearch-admin/

composer install

npm install
npm run build

cp .env.dist .env

In the .env file edit ELASTICSEARCH_URL and SECRET_REGISTER (random string to secure registration)

If Elasticsearch security features are enabled, edit ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD

You can also edit VAPID_PUBLIC_KEY and VAPID_PRIVATE_KEY to use push notifications (only in HTTPS)

You can generate values with the command below

bin/console app:generate-vapid

Add a cron command to send notifications every 5 minutes

crontab -e
# m h dom mon dow command
*/5 * * * * cd /var/www/elasticsearch-admin && bin/console app:send-notifications

Launch

(Back to installation)

Once the installation is finished, you can access the application with one of the URL below (depending on your installation):

You will see a register page to create the first user (you need the secret registration key) View

After registration you can login View

Other tools

(Back to table of contents)

Name Visit Main language Latest release*
cerebro lmenezes/cerebro Scala 18 Jun 2020
Dejavu appbaseio/dejavu JavaScript 28 Jul 2020
ElasticHQ ElasticHQ/elasticsearch-HQ Python 15 Nov 2019
Elasticsearch Comrade moshe/elasticsearch-comrade Python 30 May 2020
elasticsearch-head mobz/elasticsearch-head JavaScript 10 Apr 2018
Elasticvue cars10/elasticvue JavaScript 10 Jul 2020
ELKman www.elkman.io PHP 1 Aug 2020
Kaizen www.elastic-kaizen.com JavaFX 20 Aug 2020

Checked on 12 Sep 2020 *

License

(Back to table of contents)

MIT License

Privacy

(Back to table of contents)

This application does NOT collect and send any user data.

Development

(Back to table of contents)

You can run the application from a folder in an existing vhost (ie http://localhost/elasticsearch-admin/public)

Unit tests

(Back to development)

bin/console app:phpunit && bin/phpunit