Saturday, January 31, 2015

Redhat7 new features regarding Kernel


Dynamic kernel Patching

Red Hat Enterprise Linux 7 introduces kpatch, a dynamic "kernel patching utility", as a Technology Preview. kpatch allows users to manage a collection of binary kernel patches which can be used to dynamically patch the kernel without rebooting. Note that kpatch is supported to run on AMD64 and Intel 64 architectures only.

Swap Memory Compression

Red Hat Enterprise Linux 7 introduces a new feature, swap memory compression. Swap compression is performed through zswap, a thin back end for frontswap. Utilizing the swap memory compression technology ensures a significant I/O reduction and performance gains.

NUMA-Aware Scheduling and Memory Allocation

In Red Hat Enterprise Linux 7, the kernel automatically relocates processes and memory between NUMA nodes in the same system, in order to improve performance on systems with non-uniform memory access (NUMA).

XFS default filesystem for Redhat7

XFS  default filesystem for Redhat7

Introduction to Systemd

Introduction to Systemd

How to set up autofs


Plan:
a. First find your nfs share for your host.
# showmount -e nfs-server

b. Decide your mount mount point
/opt/nfs

============ Detail =================
1. Add enttry to /etc/auto.master file for your autofs

# cat /etc/auto.master
# /opt/nfs        /etc/auto.kuldeep

/opt /etc/auto.kuldeep

/opt/nfs  ==> // where are you going to mount - parent dir
/etc/auto.kuldeep ==>> define your child mount point and nfs share information

2. Define your nfs and nfs stuff
# cat /etc/auto.kuldeep
# archive         192.168.0.113:/opt/archive
nfs         192.168.0.113:/opt/archive

# check if its mounted
# df -h /opt/nfs/archive
df: `/opt/nfs/archive': No such file or directory

3. Restart autofs
# service autofs reload
Reloading maps

4. Verify the mount
#  df -hP /opt/nfs/archive
Filesystem                  Size  Used Avail Use% Mounted on
192.168.0.113:/opt/archive   18G   13G  3.7G  78% /opt/nfs/archive

Friday, January 30, 2015

What group you have access to on, check on windows machine

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
X:\>net users ramsing /domain
The request will be processed at a domain controller for domain fhlmc.com.
User name                    ramsing
Full Name                    Sing, Ram
Comment                      2013-03-12
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never
Password last set            12/1/2014 2:02:56 PM
Password expires             3/1/2015 2:02:56 PM
Password changeable          12/3/2014 2:02:56 PM
Password required            Yes
User may change password     Yes
Workstations allowed         All
Logon script
User profile
Home directory               \\SENTVP212\Home\ramsing
Last logon                   1/28/2015 1:59:22 PM
Logon hours allowed          All
Local Group Memberships
Global Group memberships     *TS-RDS_LAN-ALL       *MMDP_SOFTPHONE_TT
                             *ILO_LINUX_TT         *APP_RD_UNIX_ADMIN_DEV
                             *RNDP_USER_PROD_TT    *ScreenSaver_rti_TN
                             *Domain Users         *LINUX_SERVICES_RD
                             *sysadmin             *RREN_WIN7P_USERS_RE
                             *RDNM_CYGWIN_TG       *APP_TL_UNIX_ADMIN_CE
                             *ROB_sysadmin_TG      *MMOS_FIREFOX_TE
                             *NTT_ITG_USA          *RSMP_BLTRIX_ONEERP
                             *lnxp_virtual_provisio*cw_pallg
The command completed successfully.

X:\>

General overview of the server retirement process:


General overview of the server retirement process:
==> Database retirement if present
==> Middleware retirement if present
==> Any third party software or process retirement
==> Server retirement
==> Update Remedy of Server status (Assett record updated)
==> Backup of server retirement (stop backup of the server)
==> Security and monitoring tools retirement. [ E-health, eTrust (InfoSec), best1 )
==> Storage SAN of server recovery
==> Firewall rules of server retirement
==> Facility (datacenter:- Physical and Virtual servers) retirement/removal
==> DNS retirement/update of  server:  remove the hosts only from DNS Names, IP Addresses, and switchport assignments

========== Retirement process for Unix_Admin ==============

1. Before you shutting down the server, send email notification to all concern stakeholders.
Sub: CRQ00000000001 : Server retiring today 01/16/2014
Following servers listed below are retiring Today
Server1
server2
server3
Notify NOC, monitoging team that the server is no longer available and all

2. Change the status of the asset record that server is end of life (Possibly Remedy asset record)
You may want to open a ticket to asset management team to change the status.

3. Record following information
Change ticket #
hostname
Date
ip address
storage used on the system
Remove from Mornitoring tood
HW type
Add comment if any

4. On the retirement date, shut down the server into ok prompt/Single usermode or halt for linux servers.
Plan on keeping the server in this state for around 2 weeks for non-prod and 1 months for prod.
 

Tuesday, January 27, 2015

Step by step to set up Docker on Centos 7

Playing with Docker and its fun !!!

1. Update your system up to the current patch level
# yum -y update

2. Install ducker package.
# yum -y install docker docker-registry

3. Start Docker and enable it to run upon reboot
# systemctl enable docker.service
ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service'

# systemctl start docker.service

4. Verify that the docket service is starting
# systemctl status docker.service
docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
   Active: active (running) since Tue 2015-01-27 21:59:53 EST; 37s ago
     Docs: http://docs.docker.com

Note: you can add local user to use docket.

# id jay
uid=1001(jay) gid=1001(jay) groups=1001(jay)
# getent group docker
docker:x:990:

# usermod -aG docker jay
# id jay
uid=1001(jay) gid=1001(jay) groups=1001(jay),990(docker)

5. Download the docker container from Docker Index
# docker pull centos
Pulling repository centos
8efe422e6104: Download complete
511136ea3c5a: Download complete
5b12ef8fd570: Download complete
Status: Downloaded newer image for centos:latest

6. Verify that the images have been fetched locally.
# docker images centos
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
centos              centos7             8efe422e6104        3 weeks ago         224 MB
centos              latest              8efe422e6104        3 weeks ago         224 MB
centos              7                   8efe422e6104        3 weeks ago         224 MB

7. Run a basic cat command using the docker.
# docker run centos:centos7 cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)

8. Run the docker container
[root@localhost ~]# docker run -i -t centos /bin/bash
Note: -i attaches stdin and stdout, -t allocates a tty
[root@b01e2e6f2688 /]# pwd
/
[root@b01e2e6f2688 /]# ls
bin  etc   lib    lost+found  mnt  proc  run   selinux  sys  usr
dev  home  lib64  media       opt  root  sbin  srv      tmp  var
[root@b01e2e6f2688 /]# pwd
/
[root@b01e2e6f2688 /]# cat >/test.file
This is created under docker centos
[root@b01e2e6f2688 /]#

To get out off the container ( To disconnect, or detach, from the shell )
use escape sequence Ctrl-p + Ctrl-q.

[root@b01e2e6f2688 /]#
type ctrl +p and ctrl q to exit out off the docker. or you can use the exit command

[root@localhost ~]# cat /test.file
cat: /test.file: No such file or directory
[root@localhost ~]#

9. To search the docker available, use the docker search command.

[root@localhost ~]# docker search centos
NAME                                    DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
centos                                  The official build of CentOS.                   768       [OK]


[root@localhost ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS                     PORTS               NAMES
b01e2e6f2688        centos:7            "/bin/bash"            7 minutes ago       Up 7 minutes                                   sad_elion
a7ce8ce380b8        centos:7            "cat /etc/centos-rel   9 minutes ago       Exited (0) 9 minutes ago                       clever_brattain


Attach a docker container

[root@localhost ~]# docker attach b01e2e6f2688

[root@b01e2e6f2688 /]#

Install git on the server
[root@b01e2e6f2688 /]# yum install git

Complete!
[root@b01e2e6f2688 /]# git --version
git version 1.8.3.1

[root@b01e2e6f2688 /]# git config --global user.name "jay"
[root@b01e2e6f2688 /]# git config --global user.email "jay@sama.expanor.local"
[root@b01e2e6f2688 /]#

[root@b01e2e6f2688 /]# cd /opt
[root@b01e2e6f2688 opt]# cd
[root@b01e2e6f2688 ~]# cat .gitconfig
[user]
        name = jay
        email = jay@sama.expanor.local
[root@b01e2e6f2688 ~]#

or
[root@b01e2e6f2688 ~]# git config --list
user.name=jay
user.email=jay@sama.expanor.local

Disconnect, or detach, from the Docker shell

CTRL+p; CTRL+q

Commit changes to Docker

[root@localhost ~]# docker commit b01e2e6f2688 my-centos-with-git
2dd94bb41bf4b96d569aed1cc5f353282e7c40bbea3948146c841c4dddeb2df7


Check the logs on the dockers
[root@localhost ~]# docker logs b01e2e6f2688  | more

Search other available dockers.
[root@localhost ~]# docker search ubuntu

[root@localhost ~]# docker pull ubuntu
Pulling repository ubuntu
b39b81afc8ca: Download complete
511136ea3c5a: Download complete
53f858aaaf03: Download complete
837339b91538: Download complete
615c102e2290: Download complete
Status: Downloaded newer image for ubuntu:latest
[root@localhost ~]#

root@localhost ~]# docker pull fedora
Pulling repository fedora
834629358fe2: Download complete
511136ea3c5a: Download complete
00a0c78eeb6d: Download complete
Status: Downloaded newer image for fedora:latest
[root@localhost ~]#


[root@localhost ~]# docker images fedora
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
fedora              21                  834629358fe2        3 weeks ago         250.2 MB
fedora              latest              834629358fe2        3 weeks ago         250.2 MB
[root@localhost ~]#


[root@localhost ~]# docker images ubuntu
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              14.04               b39b81afc8ca        11 days ago         192.7 MB
ubuntu              14.04.1             b39b81afc8ca        11 days ago         192.7 MB
ubuntu              latest              b39b81afc8ca        11 days ago         192.7 MB
ubuntu              trusty              b39b81afc8ca        11 days ago         192.7 MB
[root@localhost ~]#


Login to UbuntU docker.

[root@localhost ~]# docker run -i -t ubuntu /bin/bash
root@0303170b0c59:/# pwd
/
root@0303170b0c59:/# cat >/test.me
This is docker UbuntU
root@0303170b0c59:/# df -h .
Filesystem                                                                                         Size  Used Avail Use% Mounted on
/dev/mapper/docker-253:1-3149016-0303170b0c59d20c65b4babfc755be19bb42809a932fd848790cfacfbde1590c  9.8G  245M  9.0G   3% /
root@0303170b0c59:/#

[root@localhost ~]# cat /test.me
cat: /test.me: No such file or directory
[root@localhost ~]#


[root@localhost ~]# su - jay
[jay@localhost ~]$ docker ps -l
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                          PORTS               NAMES
0303170b0c59        ubuntu:14.04        "/bin/bash"         2 minutes ago       Exited (0) About a minute ago                       stoic_wozniak
[jay@localhost ~]$