Skip to content

Instantly share code, notes, and snippets.

@mattmcmanus
Created December 18, 2013 15:56
Show Gist options
  • Save mattmcmanus/8024763 to your computer and use it in GitHub Desktop.
Save mattmcmanus/8024763 to your computer and use it in GitHub Desktop.
Quickly setting up Graylog2 on Ubuntu
#!/bin/bash
# Install Mongo
[[ ! `which mongod` ]] &&
(
echo " --- Installing MongoDB"
sudo apt-key add /vagrant/10gen-gpg-key.asc
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update -qq
sudo apt-get install mongodb-10gen -y -qq
)
# Installing other dependancies
echo " --- Installing JDK"
sudo apt-get install openjdk-7-jre-headless -y -qq
# from https://gist.github.com/wingdspur/2026107
[[ ! -d /etc/elasticsearch ]] &&
(
echo " --- Installing ElasticSearch"
sudo dpkg -i /vagrant/elasticsearch-0.90.7.deb
sudo cp /vagrant/elasticsearch.yml /etc/elasticsearch/
sudo service elasticsearch start
)
# Installing Graylog-Server v0.20.0-preview.8
graylog2_server="graylog2-server-0.20.0-preview.8"
[[ ! -d ~/$graylog2_server ]] &&
(
echo " --- Installing Graylog-Server"
sudo tar xfz /vagrant/${graylog2_server}.tgz -C /opt/
sudo ln -s /opt/$graylog2_server/bin/graylog2ctl /etc/init.d/
sudo cp /vagrant/graylog2.conf /etc/graylog2.conf
)
graylog2_ui="graylog2-web-interface-0.20.0-preview.8"
[[ ! -d ~/$graylog2_ui ]] &&
(
echo " --- Installing Graylog-Server"
sudo tar xfz /vagrant/${graylog2_ui}.tgz -C /opt/
cp /vagrant/graylog2-web-interface.conf /opt/$graylog2_ui/conf/graylog2-web-interface.conf
sudo ln -s /opt/$graylog2_ui/bin/graylog2-web-interface ~/
)
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment