Skip to content

Instantly share code, notes, and snippets.

@labynocle
Last active March 16, 2016 11:16
Show Gist options
  • Save labynocle/f4f9adddf41511d444c1 to your computer and use it in GitHub Desktop.
Save labynocle/f4f9adddf41511d444c1 to your computer and use it in GitHub Desktop.
Using Kopf to manage your ES 2.* cluster

Basic tuto to install a local copy of kopf to manage your brand new ES 2.* cluster. kopf will be provided by an Apache vhost.

install kopf

cd /data/vhost/k/
git clone git://github.com/lmenezes/elasticsearch-kopf.git kopf.plop.com
cd kopf.plop.com
git checkout 2.0

create your Apache vhost

<VirtualHost *:80>
  ServerName kopf.plop.com
  # Mod deflate configuration
  AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/x-javascript application/json
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  DocumentRoot /data/vhost/k/kopf.plop.com/_site/
  <Directory /data/vhost/k/kopf.plop.com/_site>
  Options FollowSymLinks
  </Directory>
  ErrorLog /var/log/apache2/kopf.plop.com-error.log
  CustomLog /var/log/apache2/kopf.plop.com-access.log "%h %l %u %t \"%r\" %>s %b \"%{Cookie}i\" \"%{Referer}i\" \"%{User-Agent}i\""
</VirtualHost>

update ES configuration

Don't forget to enable the following options in your ES configuration (otherwise you will have the famous "Allow Origin" issue). In your /etc/elasticsearch/elasticsearch.yml

http.cors.enabled: yes
http.cors.allow-origin: /.*/

You can restrict to avoid *

Now enjoy by browsing: http://kopf.plop.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment