Langsung ke konten utama

Membuat init

Init, konfigurasi yang dijalankan ketika kondisi tertentu. Misalnya ketika server tiap kali hidup.


  1. $ cd /etc/init
  2. $ sudo nano elasticsearch.conf
    Isinya kira-kira seperti ini :

    start on started networking
    stop on runlevel [!2345]

    env APPUSER="mentul"
    env APPDIR="/opt/elasticsearch-1.7.2/bin/"
    env APPBIN="elasticsearch"
    env APPCONF="/opt/elasticsearch-1.7.2/config/elasticsearch.yml"

    respawn
    exec sudo -u $APPUSER $APPDIR/$APPBIN $APPCONF
  3. $ sudo nano logstash.conf

    start on started networking
    stop on runlevel [!2345]

    env APPUSER="elog"
    env APPDIR="/opt/logstash-1.5.4/bin/"
    env APPBIN="logstash"

    respawn
    exec sudo -u $APPUSER $APPDIR/$APPBIN agent -f /opt/logstash-1.5.4/logstash.conf
  4. $ sudo nano kibana.conf

    start on started networking
    stop on runlevel [!2345]

    respawn
    exec sudo -u gembos /opt/kibana-4.1.2-linux-x64/bin/kibana /opt/kibana-4.1.2-linux-x64/config/kibana.yml
  5. Save dan coba direboot servernya

Komentar