Friday, November 20, 2015

Opensource Container Initiative- runC installation from Github


Hi all,

After long days i am writing this blog, i think it will be useful for beginner who want to work with containers.

Containers:
      It's a hot topic in todays IT world. I dont want to explain about containers. but these are the examples for containers.

  • Docker
  • rkt
  • runC 

  Docker is provided by the Docker community. rkt is provided by the CoreOs before that they used Docker as their container. And runC is the Open source container which is developed in golang (Go language).

You can find the source of runC in the following link which is available in the Github:

And also you can get lot of information in the github site itself.

runC Installation:

If you want install use runC you have go language in your system.

1. Install go from the binary:
  • Download go language binary in the follwoing link:
                                 or 
            https://golang.org/dl/
  • Runt these command to extract the archive : 
      • tar -C /usr/local -xzf go1.5.1.linux-amd64.tar.gz
  • Copy export PATH=$PATH:/usr/local/go/bin to /etc/profile
      or
  • Copy export PATH=$PATH:/usr/local/go/bin   to /root/.profile
Then run the following command in the terminal:
   $  go version
      go version go1.5.1 linux/amd64

which means go language installed successfully in your system.
Now we have to install runC library from the source. kindly follow the following steps:

2. Install libseccomp-dev from your repository and its done by running the command -
        apt-get install libseccomp-dev
3. Create one folder namely  
  • mkdir runc_gocode
  • export GOPATH=/usr/src/runc_gocode
  • cd runc_gocode/
  • mkdir src
  • cd src
  • mkdir gihub.com/opencontainers
4. You have to download the source for runC from the follwoing github link:
         git clone https://github.com/opencontainers/runc
5. cd runc
6. make
7. sudo make install ( if you are non-root user)
If no error shown means runC is installed successfully in your machine.

Run the following commands to check whether runC is properly installed or not:
$ runc -v
   runc version 0.3


In my next blog i will share you about running containers and creating vm's in runC. If you need more information kindly have a eye on runC github page. Thanks for your time.

References:

Keep explore until you got satisfied.

thanks & regards,
cooldharma06 .. :)

Friday, February 13, 2015

Log Management Tool - Opensource - Logstash + Eucalyptus + kibana

Hi all,

After long time i am writing this blog. It's about log Management.

Refer this blog for more tools: http://www.tuicool.com/articles/B7N3qq

Splunk - proprietary  software

  • one click solution
  • By web portal itself you can load data and folder it will analyse and prepare visuale your logs

Graylog2

  • Good one
  • But process the messages from TCP, UDP and other ports.
  • Using rsyslog to communicate to nodes
  • It will be good for bigger organization

Fluentd:

  • All are like plugins have to add and do the work
  • In_tail is used for reading from text files
  • Everything in json
  • Implemented with c

Logstash
  • Everythings inbuilt
  • It will be good if it combine with Elasticsearch + kibana
  • jruby runs on JVM
  • Autorefresh also we can enable in kibana3
By graylog2 you can read the log from file so we have to move with logstash. And also i am intereseted in Opensource, so i moved forward to the Logstash + Elasticsearch + kibana.

Following are the experiments which i have done:

Source:
  •  Eucalyptus - 3.4.2   ( Eucalyptus version not a problem)
  • Logstash - 1.4.2
  • Elasticsearch - 1.4.2
  • Kibana3

I tested the things for single node. After the successful installation of  Eucalyptus you will get the log under the $EUCA_HOME directory.

Configuration:

In 'elasticsearch.yml' do the following things:
      network.host: IP
      discovery.zen.ping.multicast.enabled: false
      discovery.zen.ping.unicast.hosts: ["hostname" ]
      http.cors.enabled: true
      http.cors.allow: "/.*/"

If you are installing logstash from the deb the configuration files are located under the following directory:
       /etc/logstash/conf.d/*

Logstash will grep the logs based on the configuration files.

Here only we have to pass our configuration files which contains 
       sample.conf
      input {
            ... files location to grep the logs
       }
        filter{
             ... Grok patterns to filter the logs from log file
         }
         output{
                ... redirecting to stdout or to elasticsearch
           } 

Now kibana3 have to be extracte and keep under your /var/www/kibana3/*. So your kibana3 will run under your webbrowser.

To run your elasticsearch in background:
./elasticsearch &

To run your logstash to grep the logs:
./logstash -f /etc/logstash/conf.d/eucalyptus_cloud.conf

then redirect your browser to the http://ip/kibana3 link it will show the visualized pattern of eucalyptus logs.

Based on the search pattern you can grep the logs like ERROR, INFO, cc.log.

It will give the visualization as:



For more guidelines please refer the following links:

Credits to:
https://www.digitalocean.com/community/tutorials/how-to-use-logstash-and-kibana-to-centralize-and-visualize-logs-on-ubuntu-14-04
http://logstash.net/docs/1.4.1/configuration
http://grokconstructor.appspot.com/do/match?example=0
https://www.eucalyptus.com/blog/2013/08/23/extracting-info-euca%E2%80%99s-logs

Regards,
cooldharma06.. :)

.. Always be cool ..