Install ansible on Centos 7 / RHEL 7

Install ansible on Centos 7 / RHEL 7

1. Install epel-release package

yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

2. Installation

2.1 Update the OS
             yum update

2.2 Install the ansible
             yum install ansible

2.3 check ansible version
            ansible –version

 

Install Grafana on CentOS/Rhel 7

  1. Download the rpm file

    wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm

  2.  install initscripts & fontconfig

     yum install initscripts fontconfig urw-fonts

  3.   Install Grafana rpm file

    rpm -ivh grafana-4.6.3-1.x86_64.rpm

  4.  Enable and start Grafana service

    systemctl enable grafana-server.service

    systemctl start grafana-server.service

  5.  After that Grafana can be accessed using the url http://<ipaddress>:3000/. Default username and password is admin / admin.

 

Install Jenkins in Centos 6.8

1. Install Java

$ yum install java

2.  Installing the Jenkins repo

$ wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo

3.  Import the verification key

$ rpm –import https://jenkins-ci.org/redhat/jenkins-ci.org.key

4. Install Jenkins

$ yum install jenkins

Note: Download and install RHEL repo if needed,

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}
span.s1 {font-variant-ligatures: no-common-ligatures}

 

wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}
span.s1 {font-variant-ligatures: no-common-ligatures}

rpm -ivh epel-release-6-8.noarch.rpm

5. Start Jenkins

$ service jenkins start

6. Access the Jenkins using the url http://<ip-address>:8080
Then copy and paste the key  Administrator password from the file /var/lib/jenkins/secrets/initialAdminPassword

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}
span.s1 {font-variant-ligatures: no-common-ligatures}

 

7.  Select and install the required plugins

 

8. Create user first Admin User

 

RHEL 6.5 partition 3TB harddisk using gparted

RHEL 6.5 partition 3TB harddisk using gparted

For my senario,the fdisk -l shows 3TB hdd connected as /dev/sdb

1. So started parted using ,
parted /dev/sdb

2.  create gpt disk label,
mklabel gpt

3. change unit to TB
unit TB

4.  create 3TB partition
mkpart primary 0.00TB 3.00TB

5. fdisk -l , shows that a new partition /dev/sdb1 is created of 3TB in size

 

5.   To format as EXT4 filesystem,
mkfs.ext4 /dev/sdb1

Docker Installation on Fedora 24

Docker Installation on Linux – Fedora 241.  Update the fedora packages,

        #  dnf update
2.  Create the docker.repo file and add the following entries;

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/fedora//
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

3. Now install the docker-engine
4.  Now enable the docker service and start the docker.
5.  To test docker installation,

 

Puppet Agent install and configuration on CentOS/Redhat

1. Download the puppet agent from http://puppet.com
or go directly to https://puppet.com/download-puppet-enterprise/thank-you

2. Upload the rpm file to the server and run

rpm -ivh puppet-agent<version>.rpm

Note: Here I am using Centos 6.5 –  64bits OS

3. Configure puppet agent to point to the master server.
3.1   Open the file /etc/puppetlabs/puppet/puppet.conf and add the following entires

[main]
certname = puppetclient1.com
server = puppetmaster.com
environment = production
runinterval = 1h

3.2 Run puppet agent -t from the client

3.3 Accept the client cert from the Puppet master server

Installing Puppet Enterprise on Linux server

Installing Puppet Enterprise on Linux server

1.  Go to https://puppet.com/ and download the .tar.gz Puppet enterprise master and Agent installation      files.
eg: for centos7
 https://pm.puppetlabs.com/cgi-bin/download.cgi?dist=el&rel=7&arch=x86_64&ver=latest
2.  Upload the puppet-enterprise tar.gz file to the Puppet Master Server.
Here we are using a server installed with CentOS

3. untar the installation file

4. Now we will start the  Puppet Enterprise Master installation.
Go to the folder and run the installer file puppet-enterprise-installer

Note:  if you are not using a DNS server, add the entries for the IP address and hostname in the /etc/hosts files

5.  Press ‘Y’ to continue installation

6. As shown in the above pic, open a browser and go to the url mentioned.
Here we are opening https://puppetmaster:3000
Click “Let’s get started!”  to continue the installation.

Note: If you are accessing GUI from a different desktop/server make sure that the port 3000 and 443 ( for later use ) is open between them

7. Choose your deployment mode.
Since my environment is less than 7000 nodes,  I am using only 1 master server, I am going with Monolithic.

8. Enter the puppet master FQDN and Puppet master DNS alias.

Note: if you don’t have a DNS server, make sure that these entries are added to /etc/hosts file

9.  Enable Application Orchestration

10
10.1  Select the database support needed.
Here I am selecting the option to install the PostgresSQL and to create PuppetDB database on it      during the installation.
10.2 Enter the admin password, this is need to login to the Enterprise GUI console after installation.

11. Confirm the plan and click “continue”

11.  If there are no messages in red color, click “Deploy now”.

12. Now the Puppet entries is getting installed.

13. After installation you can login to the Puppet Enterprise GUI using https://puppetmaster url and user name as admin and password  given in step 10.2

 

Create LVM on CentOS / RHEL 5.8

How to add 3 new external hdds and create LVM on it.

steps required to configure LVM include:

 

  • Creating physical volumes from the hard drives.
  • Creating volume groups from the physical volumes.
  • Creating logical volumes from the volume groups and assign the logical volumes mount points
In this case external hdds connected to the server as /dev/sdc, /dev/sdd, /dev/sde
[ The command fdisk -l  will show the hdds connected to the server ]
1. Create a partition on the hdd and change file system to 8e (LVM )
Note:- This is a destructive process, and make sure that any data in the hdd is backed up before proceeding.
  a) fdisk /dev/sdc
  b) enter “n” to create partition,
         enter “1” to create primary partition
         select start and end as default (just press enter at both prompts )
  c) enter “t” to change the file system type and enter ‘8e’ for LVM
  d) enter “w” to save the changes
  e) enter “q” to exit
2)  Create Physical volume

 

3) Create Volume group from the Physical volumes create

Here I am creating a Volume group  “DB_TEST_EXTERNAL”

 

4) Create Logical Volume from the Volume group

Here I am creating a Logical Volume named “LV_DATA”

5)  Create filesystem on the share

mkfs.ext3 /dev/DB_TEST_EXTERNAL/LV_DATA

 

Find HBA WWPN in RHEL / CentOS 5.x

Find HBA WWPN in RHEL / CentOS 5.X

Method1:

1) Run the following command to find the manufacturer of the HBA card

[root@host ~]# lspci |grep -i HBA
07:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
0a:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)

2) To find the WWPN number use the following command and look for port_name

systool -c fc_host -v

[root@host ~]# systool -c fc_host -v |grep “port_name”
port_name           = “0x500XXXXXXXXXXX7e”
port_name           = “0x500XXXXXXXXXXX4a”

Method2:

[root@host ~]# cat /sys/class/scsi_host/host1/device/fc_host:host1/port_name
0x500XXXXXXXXXXX7e
[root@host~]# cat /sys/class/scsi_host/host0/device/fc_host:host0/port_name
0x500XXXXXXXXXXX4a