Skip to main content

How to install Graylog v0.20.0

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.):

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"
If all these steps passed smoothly, it is time to install graylog-web-interface.Run following script to download and extract the source:

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"
 Now, you can open the web interface via url http://127.0.0.1:9000.

I have pushed a Chef cookbook to github, which automates this configuration. Visit cookbook.

Comments

Popular posts from this blog

Integration of MuPDF Project as a Library into an Android Studio Project

I have needed to use MuPDF library in my android project. After some research, I have seen that there are many integration tutorials but, but integrated projects are developed on Eclipse. For projects on AndroidStudio+Gradle, there is no example. I mean there is no specific example which exactly refers to this issue. So, after achieving my goal, I want to share the steps publicly so that it can be reused by others.

Migration from Proxmox to Openstack

I needed to migrate virtual machines in proxmox to openstack. VMs are in raw format. I needed to take some actions for a succesfull migration. I have perform all actions on Ubuntu 12.04 with virt-manager. qemu-kvm is installed. Here is the list of actions that I took: First, close the machine and copy the image file into your Ubuntu. Convert raw image to qcow2 format: qemu-img convert -O qcow2 image1.raw image1.qcow2 You need the image in qcow2 format for compatibility with openstack platform.  Open the converted image in virt-manager. Before opening, edit disk options. Under ' advanced options ' section, select ' qcow2 ' as ' storage forma t '. Start the virtual machine. You should see the login screen soon. (If you don't set storage format, vm will not find a bootable device. )   If everything is ok so far, close the vm. Take qcow2 image and upload it into glance. It may take time depending on size of it. After this process is completed, open a...

How to avoid API-level warning of Android Studio

Before giving the solution, let's start with a scenario. setSelectionFromTop() is a new method in Android Lollipop API. This method is basically beneficial to precisely keep scroll state of a ListView. By keeping that info, a developer can go back to old scroll state after doing some operation like data set change. You are aware of API level and you do your control before you call this function: if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { srlistview.setSelectionFromTop(index, top); } But if project minSdk is set to a lower level (in this case it is 15), this warning will still be displayed in Android Studio: