start jenkins container

1) Install docker:

Fedora 21:

sudo yum -y install docker

Fedora 20

$ sudo yum -y remove docker
$ sudo yum -y install docker-io

2) Start docker

$ sudo systemctl start docker
$ sudo systemctl enable docker

3) Pull jenkins container

$ docker pull jenkins

4) Start jenkins container on port 8080

$ docker run -p 8080:8080 jenkins
Advertisements

Setup Chef on standalone PowerKVM Environment

1) What it is?

Chef simplifies the way you perform infrastructure automation and configuration management tasks. The standalone installation of the Chef  creates a working installation on a single server.   This setup is on  standalone environment on PowerKVM node. (No separate chef server is configured.)

2) How to install on powerkvm node.

yum search chef
============================================================================== N/S matched: chef ===============================================================================
chef.ppc64 : The full stack of chef

yum install chef.ppc64

3) Configuration files:

web.json:   This is a pointer to recipe, which user would like to run.

solo.rb: only sets two paths for Chef Solo.

default.rb: sample recipe which user would like to run. User need to keep adding recipes  as per his/her requirements

3.1) Example Cookbook  to start kimchid service on powerkvm.

cat /root/chef-repo/cookbooks/demo/recipes/default.rb

#
# Cookbook Name:: demo
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved – Do Not Redistribute
#

package ‘kimchi’ do
action :install
end

service ‘kimchid’ do
action [  :enable, :start ]
end

3.2) chef.solo

cat chef-repo/solo.rb
file_cache_path “/root/chef-solo”
cookbook_path “/root/chef-repo/cookbooks”

3.3) web.json

cat web.json
{
“run_list”: [ “recipe[demo]” ]
}

4) How to run

chef-solo  -c chef-repo/solo.rb -j web.json
[2014-09-16T13:42:49+01:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

“`
# Verify all HTTPS connections (recommended)
ssl_verify_mode :verify_peer

# OR, Verify only connections to chef-server
verify_api_cert true
“`

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

“`
knife ssl check -c chef-repo/solo.rb
“`

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Starting Chef Client, version 11.12.8
Compiling Cookbooks…
Converging 2 resources
Recipe: demo::default
* package[kimchi] action install (up to date)
* service[kimchid] action enable
   – enable service service[kimchid]

* service[kimchid] action start (up to date)

Running handlers:
Running handlers complete

Chef Client finished, 1/3 resources updated in 4.874421085 seconds

Monitor PowerKVM using Nagios

Why Nagios?

Nagios is a system and network monitoring application. It watches PowerKVM hosts and  services that user specify

Nagios monitoring will be enabled via NRPE (nagios remote plugin-executor) which is the preferred method for remote monitoring of hosts.

What it can do ?

Alerting user when things go bad and when they get better. Nagios plugins that will be available by default
◦ Load average
◦ Disk usage
◦ Process Count and Resource Usage
◦ Log analysis
custom python scripts as nagios plugins provide any additional monitoring capability

Install packages:

[root@powerkvm-host ~]#  yum -y install nagios nagios-common nagios-plugins-*

Add PowerKVM node to nagios server:

#restart nrpe agent

Add configuration file for each powerkvm node in nagios server

Powerkvm Host state Breakdown by nagios

Program wide performance by nagios

Thanks to Yogananth Subramanian1

Monitor PowerKVM using Ganglia

Why Ganglia ?

1.Scalable Distributed Monitoring System
2. Targeted at monitoring high performance computing systems
3. Light weight and easy to manage agent
4.  Monitoring agent retrieve and provide system usage data to Ganglia server

What it can do ?

Monitor PowerKVM nodes & Virtual machines running on it.
List all VM’s running on PowerKVM nodes and their current/past states.
CPU, Memory, Disk & Network, SSL Metrics
TCP, UDP, TCPEXT Metrics and also Custom metrics can be added.

1)  Configure each PowerKVM Client node need to be monitored

1) Install packages

[root@powerkvm-host ~]#  yum -y install  ganglia-gmond

By default its installed on powerkvm box

2)  Modify /etc/ganglia/gmond.conf as per your requirements.   In My setup only cluster name & host in  usdp_send_channel are changed.

for ex:

cluster {
name = “powerkvm-cluster”
owner = “unspecified”
latlong = “unspecified”
url = “unspecified”
}

udp_send_channel {
bind_hostname = yes # Highly recommended, soon to be default.
# This option tells gmond to use a source address
# that resolves to the machine’s hostname.  Without
# this, the metrics may appear to come from any
# interface and the DNS names associated with
# those IPs will be used to create the RRDs.
mcast_join = 239.2.11.71
host = powerkvm.ibm.com
port = 8649
ttl = 1
}

3) service gmond restart

2) Ganglia server Configuration:

Ganglia server cannot be powerkvm server. You can setup ganglia server on a PowerLinux VM running on same host or separate box.. etc

1)Install ganglia packages

[root@ganglia-server ~]

yum -y install ganglia ganglia-gmetad ganglia-web ganglia-gmond  ganglia-gmond-python

2) vi /etc/ganglia/gmetad.conf

#Add powerkvm client node host name and ip

data_source “powerkvm-host” <IP>

3) Modify /etc/ganglia/gmond.conf as per your requirements.  You can continue with default setup too.  In my setup nothing is changed except cluster name.

vi /etc/ganglia/gmond.conf

#

cluster {
name = “my cluster”
owner = “unspecified”
latlong = “unspecified”
url = “unspecified”
}

udp_send_channel {
#bind_hostname = yes # Highly recommended, soon to be default.
# This option tells gmond to use a source address
# that resolves to the machine’s hostname.  Without
# this, the metrics may appear to come from any
# interface and the DNS names associated with
# those IPs will be used to create the RRDs.
mcast_join = 239.2.11.71
port = 8649
ttl = 1
}

udp_recv_channel {
mcast_join = 239.2.11.71
port = 8649
bind = 239.2.11.71
retry_bind = true
# Size of the UDP buffer. If you are handling lots of metrics you really
# should bump it up to e.g. 10MB or even higher.
# buffer = 10485760
}

4) Change ganglia config in httpd. Grant access from all.

vi /etc/httpd/conf.d/ganglia.conf

<Location /ganglia>
Require all granted
# Require ip 10.1.2.3
# Require host example.org
</Location>

service httpd restart

4) service gmond restart
5) service gmetad  restart

3) Monitor Gaphs from Web browser. 

<Ganglia server ip>/ganglia

Graphs:

CPU Metrics

Procstat & SSL

udp Metrics

 TCP Metrics

CPU Metrics