Tuesday, December 8, 2015

Docker installation and proxy settings from docker site (Cent OS)

I - Installation :-

1)Adding docker yum repository to your local machine.

#vi  /etc/yum.repos.d/docker.repo

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
#Proxy config -- optional
#proxy=http://192.168.1.1:80
#proxy_username=domainname\username
#proxy_password=password

2)Install docker throught yum

#yum install docker-engine

3)start & check status of docker service using systemctl

#systemctl start docker.service
#systemctl status  docker.service

II - Docker Proxy configuration for  docker image :- 

1)create a directory for docker service

#mkdir /etc/systemd/system/docker.service.d

2)Add proxy settings in config file

#vi /etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment="http_proxy=http://domainname\username:password@192.168.1.1:80"

3)Reload docker config and restart docker service

  # systemctl daemon-reload
  # systemctl show docker --property Environment
  # systemctl restart docker

4)Check docker service and pull ubuntu image

  #docker run hello-world
  #docker run -it ubuntu bash

5)check docker version
 
  #docker info

Monday, October 26, 2015

Raspberry PI static IP setup - Wireless wlan0


1)Edit network card and add ip / broadcast / gateway address

pi@raspberrypi ~ $ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.33
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

pi@raspberrypi ~ $

2) Add wifi router name & password

pi@raspberrypi ~ $ sudo cat  /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="hubname"
        psk="password"
        key_mgmt=WPA-PSK
}
pi@raspberrypi ~ $

3)View your ip


pi@raspberrypi ~ $ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:915 errors:0 dropped:148 overruns:0 frame:0
          TX packets:329 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:202526 (197.7 KiB)  TX bytes:49840 (48.6 KiB)

pi@raspberrypi ~ $

simple google search can fetch lots of results  but this post is for my reference :) ,Today My Raspberry PI2 DAY :)




Wednesday, April 8, 2015

Tomcat startup script - Tomcat V6/7/8 - Linux

Tomcat startup script :-

Script based  Tomcat lifecycle management is good in Production and test environment,Befor starting  Tomcat server we have to export Tomcat variables in system level

most common varialbes are :-

1)CATALINA_BASE     - Tomcat installation location
2)CATALINA_HOME   - Tomcat instance location if you are running multible instance in same machine .
3)CATALINA_OPTS    - Server scope java options  eg time zone ,language support etc
4)CATALINA_OUT      - Catalina.out file location - jvm output will be store in this file
5)CATALINA_PID        - Tomcat server process id file
6)JAVA_HOME             - Java home
7)JAVA_OPTS              - Java options - JVM options , heapsize ,minimum & maximum memor size , tunning parameters

Sample  bash script which is used to start  owcs 11g  hosted tomcat instance .

startup.sh

#!/bin/sh

FW_UID=11112

if [[ $EUID -ne $FW_UID ]]; then
  echo "This script must be run as  tomcat user"  1>&2
  exit 1
else

CATALINA_OUT=/owcs/logs/dev/editorial/catalina.out
CATALINA_BASE=/owcs/dev/editorial/cs_tomcat
CATALINA_HOME=/owcs/apache-tomcat-6.0.37
CATALINA_PID=/owcs/pids/dev_editorial_pid
JAVA_HOME=/owcs/jdk1.6.0_45
CLASSPATH=$CATALINA_HOME/lib/ojdbc6.jar:$CATALINA_BASE/cs_tomcat/webapps/cs/WEB-INF/lib/MSXML.jar:/owcs/dev/owcs-editorial/bin:$JAVA_HOME/lib/tools.jar
JAVA_OPTS="-Xms2048m -Xmx2048m -Xss512k -Xloggc:/owcs/logs/dev/editorial/verbosegc.$$ -XX:PermSize=512m -XX:MaxPermSize=650m -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Duser.timezone=Europe/London -Dcom.sun.management.jmxremote -Dfile.encoding=UTF-8 -Dcs.useJavaURLDecoder=false -Dcs.useEhcache=true -Dnet.sf.ehcache.enableShutdownHook=true -DenableErrorPropagation=true -Djava.library.path=/owcs/dev/owcs-editorial/bin -Djava.awt.headless=true"

export CATALINA_OUT CATALINA_BASE CATALINE_HOME CATALINA_PID JAVA_HOME JAVA_OPTS CLASSPATH

case $1 in
'start')
        exec "$CATALINA_HOME"/bin/catalina.sh start "$@"
        ;;

'stop')
        exec "$CATALINA_HOME"/bin/catalina.sh stop -force "$@"
        ;;

*)
        echo "usage: $0 {start|stop}"
        rval=1
        ;;
esac
fi

Reference :-

http://tomcat.apache.org/tomcat-6.0-doc/index.html

Monday, April 6, 2015

Yum based Docker installation (Redhat EL 6.6 )

Yum based Docker installation :-

Requirements :

1)Redhat linux 6.5 or above
2) EPEL Repository

Procedure :-

1) Download EPEL 6 - 64 bit repository 

#rpm -ivh  http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
#yum update
#yum repolist

2) Install docker-io through yum 

#yum -y install docker-io

3) Disable selinux 

#SELINUX=disabled in  /etc/selinux/config file and reboot system

4) Start and enable docker daemon 

#service docker start
#chkconfig docker on
#service docker status

6) Check docker installation - 250 MB download from internet depends on your download speed

# docker run -i -t fedora /bin/bash

Unable to find image 'fedora:latest' locally
fedora:latest: The image you are pulling has been verified

511136ea3c5a: Pull complete
00a0c78eeb6d: Pull complete
834629358fe2: Pull complete
Status: Downloaded newer image for fedora:latest


Reference :-

1) http://docs.docker.com/installation/rhel/

Monday, June 9, 2014

JRockit 1.6 64 bit installation on Redhat Linux 6 64 bit .

In production systems we use JRockit jvm for weblogic application server .

1)Copy bin format jrockit 1.6 installer into your linux box /opt directory .
     scp jrockit-jdk1.6.0_37-R28.2.5-4.1.0-linux-x64.bin root@localhost:/opt 

2)Add execute file permission into installer.
   #chmod +x  jrockit-jdk1.6.0_37-R28.2.5-4.1.0-linux-x64.bin

3)Execute jrokit 1.6 installer .
   #./jrockit-jdk1.6.0_37-R28.2.5-4.1.0-linux-x64.bin
  Follow the wizard  if you want to change installation location you can specify directory location during the installation .

eg: 

<------------------------- Oracle JRockit Installer - Oracle JRockit JDK R28.2.5 for Java SE 6 with JRMC 4.1 ------------------------>

Choose Product Installation Directory:
--------------------------------------

    "Product Installation Directory" = [Enter new value or use default "/root/jrockit-jdk1.6.0_37-R28.2.5-4.1.0"]

     Enter new Product Installation Directory OR [Exit][Previous][Next]> /opt/jrockit1.6.0_37

4)Once installation completed then check jrockit installed directory 
    eg 
      # ll /opt/jrockit1.6.0_37
       total 260
      drwxr-xr-x. 2 root root   4096 Sep 27  2012 bin
      drwxr-xr-x. 3 root root   4096 Sep 24  2012 include
      drwxr-xr-x. 3 root root   4096 Jun  9 14:02 inventory
      drwxr-xr-x. 4 root root   4096 Jun  9 14:02 jre
      drwxr-xr-x. 2 root root   4096 Sep 24  2012 lib
      drwxr-xr-x. 6 root root   4096 Jun  9 14:02 missioncontrol
      -rw-r--r--. 1 root root 239443 Sep 27  2012 THIRDPARTYLICENSEREADME.txt

     


   

Thursday, November 14, 2013

Remote Display using ssh - xterm issue

When you try to access remote system display through ssh you may get below error .

$ xterm
xterm Xt error: Can't open display: 
xterm:  DISPLAY is not set
CHECKING REMOTE DISPLAY CONFIGURATION 

$ echo $DISPLAY

CHANGE BELOW VALUES IN THE FILE 

$ VI /etc/ssh/sshd_config 
X11Forwarding yes
X11DisplayOffset 10
RESTART THE SSHD SERVICE
#service sshd restart 
CONNECT REMOTE SERVER 
#ssh -X root@remoteserver.com
TEST X SERVER DISPLAY
#xterm

Monday, September 30, 2013

Linux Simple NFS Sharing (Redhat/Centos/etc..)

This procedures for  simple nfs sharing

Server Side : (192.168.0.1)

1) Install nfs package (nfs,nfs utils,rpcbind are packages are required )
    #yum install nfs*

2) Export nfs sharing folders
    #vi /etc/exports
 
  eg : /nfs folder export to all network with read and write access
               # cat  /etc/exports
                      /nfs *(rw)
3)start the nfs services (nfs using rpcbind port number 2049)

#service rpcbind start
#service nfs start
#chkconfig rpcbind on
#chkconfig nfs on

4)exporting the  shares

   #exportfs -av
 
5)verifying  exports

  #showmount -e localhost
 
Client Side : (192.168.0.2)
  mounting NFS sharing  to local machine 
 
1)create mount directory
   #mkdir /nfs
 
2)installing nfs packages

   #yum install nfs*
 
3)staring the nfs service (first we need to start rpcbind as nfs using rpcbind port number 2049)

   #service rpcbind start
   #service nfs start
   #chkconfig rpcbind on
   #chkconfig nfs on

4)mounting nfs share

  #mount -t nfs 192.168.0.1:/nfs  /nfs

5)check the mount points

  #mount