There are three major dependencies of graylog: java, mongodb and elasticsearch.
Either install openjdk-7-jdk or oracle java-7 (In this guide, oracle-java is installed.):
I have pushed a Chef cookbook to github, which automates this configuration. Visit cookbook.
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
Then, install elasticsearch:
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb
sudo dpkg -i elasticsearch-0.90.10.deb
Set cluster.name in /etc/elasticsearch/elasticsearch.yml file to some unique name which may be hostname of the server. Setting it to 'graylog' as written in Torch graylog installation guide may violate other graylog servers if exists.
Then, install mongodb:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
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
sudo apt-get install mongodb-10gen
You may manually create database named as 'graylog2' and add user to it for authentication. However, if graylog and mongodb servers both are located in the same server, you can just leave mongodb as it is, since mongodb listen initially only 127.0.0.1 and refuses connection requests from other servers.
Now it is time to install graylog2 v0.20.0:
src="graylog2-server-0.20.0-rc.2.tgz"
wget https://github.com/Graylog2/graylog2-server/releases/download/0.20.0-rc.2/$src
tar zxf $src
rm -f $src
mv graylog2-server-* /opt/graylog2-server
cd /opt/graylog2-server
In this directory, copy graylog2.conf.example file to /etc/ directory as "graylog2.conf"(simply run cp graylog2.conf.example /etc/graylog2.conf). Then, begin to edit it, since there are some key properties to set.- Run 'pwgen -s 96 1' and set 'password_secret' to the output.
- Run 'echo -n yourpassword | shasum -a 256' and set 'root_password_sha2' property with the output hash value. Don't forget 'yourpassword'. You will login into web interface with pair "admin:yourpassword".
- Set "elasticsearch_cluster_name" with the cluster name of elasticsearch server. Other properties may remain as it is.
- Configure mongodb properties. If you didn't enable authentication for mongodb, following configuration will be enough:
mongodb_useauth = false mongodb_host = 127.0.0.1 mongodb_database = graylog2 mongodb_port = 27017
- For further configuration, visit.
- Finally, run graylog "./bin/graylog2ctl start"
file="graylog2-web-interface-0.20.0-rc.2.tgz"
wget https://github.com/Graylog2/graylog2-web-interface/releases/download/0.20.0-rc.2/$file
tar zxf $file
rm -f $file
Get into "graylog2-web-interface-0.20.0-rc" folder and edit configuration file "conf/graylog2-web-interface.conf".- Set graylog2-server.uris to "http://127.0.0.1:12900/"
- Set application.secret to output of "pwgen -s 96 1" command as done above.
- Set timezone property to timezone of the server. Be sure that they are exactly same to avoid compatibility issues. So, before taking this action, I recommend to set the timezone with command "sudo dpkg-reconfigure tzdata" or get with "date +%Z". Be aware of which timezone selected and set the property timezone in the config file to it.
- Run web interface with command : "./bin/graylog2-web-interface"
I have pushed a Chef cookbook to github, which automates this configuration. Visit cookbook.
Comments
Post a Comment