Friday, March 3, 2017

Jenkins Error : ERROR: Error cloning remote repo 'origin'

If you upgraded and you face following error. 
Started by user shrikant
Building on master in workspace /var/lib/jenkins/workspace/DEvops
Cloning the remote Git repository
Cloning repository
 > git init /var/lib/jenkins/workspace/DEvops # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /var/lib/jenkins/workspace/DEvops
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(
at hudson.plugins.git.GitSCM.retrieveChanges(
at hudson.plugins.git.GitSCM.checkout(
at hudson.scm.SCM.checkout(
at hudson.model.AbstractProject.checkout(
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(
at jenkins.scm.SCMCheckoutStrategy.checkout(
at hudson.model.AbstractBuild$
at hudson.model.Run.execute(
at hudson.model.ResourceController.execute(
Caused by: hudson.plugins.git.GitException: Error performing command: git init /var/lib/jenkins/workspace/DEvops

** Solution is This **

Enter Jenkins System Configure (Jenkins -> Manage Jenkins -> Configure System )
When you mention absolute path.

 Go Here
and check your git path e.g. /bin/git or /usr/local/bin/git, /usr/bin/git etc.
This error will go away! 

Tuesday, July 14, 2015

Application Deployment on ISeries/IBM i /OS 400

Application Deployment on IBM Power Series i.e.  ISeries/IBM i /OS 400

We all knows Deployment on *Nix base System/Platforms most of all flavors but do you know how to deployment on IBM Power Series ?

Here I have tried and done successful deployment with tools like: Jenkins and Capistrano.

Jenkins :
1. Object base Deployment i.e. File/Folder etc.
2. With Publish Over SSH plugin

It is pushing code from source to destination directory and after that you can add shell script for post and pre build.
You can configure SSH option with Password either SSH key.

Capistrano :
1. Using Source Control Repository ( Version Control i.e. SVN/GIT/CVS)
2. Using Pre and Post build script using custom Cap recipes.

In this case Cap is clone or exporting code from version control system. Capistrano is purely interactive ruby script.

So if anyone interested for more details please let me know. :)

Tuesday, June 11, 2013

Mysql Enterprise Monitor Server and Agent Installtion.

MEM Server:


MEM Installtion:

cd /opt/mysql/enterprise/agent/etc/instances
mysql mysql1 sd2 sq1 sq2         (You can configure Agents here.)
E.g. cp -a sq2 sq3

then Enter in that Dir.

cd sq3/ >> Edit agent-instance.ini

And Add your agents hostname in that file:

/etc/init.d/mysql-monitor-server restart

/etc/init.d/mysql-monitor-agent restart

Agent Installation:
Create User in mysql on agent

mysql > GRANT ALL ON *.* TO 'agent'@'localhost' identified by 'agent123';

then :

cd /opt/mysql/enterprise/agent/etc/
vi mysql-monitor-agent.ini

check this config :

# Agent Parameters

agent-mgmt-hostname =     (You need to check this if agent not connecting.)
agent-mgmt-username = agent
agent-mgmt-password = agent
mysqld-instance-dir= etc/instances

agent-item-files = share/mysql-monitor-agent/items/items-mysql-monitor.xml,share/mysql-monitor-agent/items/items-mysql-cluster.xml,share/mysql-monitor-agent/items/custom.xml

agent-uuid = 587a1d86-0a7d-46ed-bbf4-8bc2d423a97b

user = root

/etc/init.d/mysql-monitor-agent restart

Thursday, May 23, 2013

How To Upgrade The Mysql To Percona on WHM/cPanel Server.!

Imp: Please take backup of database and mysql config file my.cnf

cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old

Check the Mysql version:

mysql -V
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64)

We need to Disable the Mysql in cPanel:

/scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled

The following script will remove the mysql from your server.

/scripts/check_cpanel_rpms --fix --targets=MySQL51

Then, Download the Percoana repository and install it on server:

rpm -Uhv

Preparing...                ########################################### [100%]
   1:percona-release        ########################################### [100%]

After that you can install the Percona server and req. pacakges.

 yum install Percona-Server-client-55 Percona-Server-server-55 Percona-Server-devel-55 Percona-Server-shared-55 Percona-Server-55-debuginfo.x86_64   Percona-Server-test-55.x86_64

Start the Percona Mysql:
/etc/init.d/mysql start

Upgrade your data with Percona: It will shows you "OK" if its done successfully.

Then again restart the Mysql:
/etc/init.d/mysql restart

Now, For PHP and Apache you have to rebuild the Apache and PHP using following script:
/scripts/easyapache --build

After completion it will shows you.

!! Build Complete! !!

Good You Done IT..Now you can have well optimized PerconaDB.. and you can Enjoy the performance :)

Tuesday, April 9, 2013

Nginx-php-fpm Installation With Yum on Centos.

Install Nginx with php-FPM
 rpm -Uvh

yum install nginx  php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-xcache php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy

vi /etc/nginx/conf.d/domain.conf
server {
   listen 80;
   server_name www.domain domain;
   root /usr/share/nginx/html;
   location / {
       index  index.html index.htm index.php;
   location ~ \.php$ {
       include /etc/nginx/fastcgi_params;
       fastcgi_index index.php;
       fastcgi_param  SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;

/etc/init.d/nginx restart

 /etc/init.d/php-fpm restart

You can check php-fpm if it is running
[root@yo html]# netstat -anltup | grep php-fpm
tcp        0      0    *                   LISTEN      23249/php-fpm

Thursday, April 4, 2013

PV Name unknown device

If you allocate the one volume to one VM and you did created PV after that you did dettach the volume without unmounting the volume.
So here is the procedure how to troubleshoot with it.

[root@localhost ~]#  pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               VolGroup00
  PV Size               19.89 GB / not usable 19.49 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              636
  Free PE               0
  Allocated PE          636
  PV UUID               KhAEcp-48eH-a3nz-HFzF-sXPt-4duo-Vl0NAa

  --- Physical volume ---
  PV Name               unknown device
  VG Name               VolGroup00
  PV Size               10.00 GB / not usable 32.00 MB
  Allocatable           yes
  PE Size (KByte)       32768
  Total PE              319
  Free PE               319
  Allocated PE          0
  PV UUID               7CeL4J-wKL1-EigZ-YpWc-qufr-Gbwp-UcFOne

[root@localhost ~]# vgreduce --removemissing --force

Now just check following things.. your issue is resolved.
[root@localhost ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                1
  VG Size               29.84 GB
  PE Size               32.00 MB
  Total PE              955
  Alloc PE / Size       636 / 19.88 GB
  Free  PE / Size       319 / 9.97 GB
  VG UUID               7o4aWW-Euef-k2Ti-n4rt-QTB0-6RZr-4u7Y9w

Wednesday, February 27, 2013

Clean up old backup files.

For clean up old backup files.

cat  /backup/

#find /backup/scripts -type d -mtime +10 -name "2009*" -exec rm -rf {} \;
find /backup/scripts/201* -type d -mtime +10 -exec rm -rf {} \;

mail -s "Daily Report for `hostname`" < /home/shrikant/daily_report/D_Report_$(date +\%d\%b\%y-\%H%M).txt

mail -s "Hourly Check Result of `hostname` " < /home/shrikant/daily_logs/oraprod_$(date +\%d\%b\%y-\%H\%M).txt

mail -s "Syslog check of `hostname`" <  /home/shrikant/chksyslog/oraprod1_$(date +\%d\%b\%y-\%H\%M)

Tuesday, January 22, 2013

History command With Date and Time In Linux.

Add the line at end of file.

[root@neonserv ~]# vi  /etc/bashrc

# vim:ts=4:sw=4
test -s /etc/bash.bashrc.local && . /etc/bash.bashrc.local

Create one file name  "/etc/bash.bashrc.local"  and edit like as follows.

[root@neonserv ~]# vi /etc/bash.bashrc.local

#local bashrc mods
# turn on date time stamps in history
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
export HISTCONTROL=ignoreboth
export HISTSIZE=2000

So when you will fire command output will be like this:
[root@neonserv ~]# history
 1033  Jan/22 - 15:30:44 accton
 1034  Jan/22 - 15:31:16 /etc/init.d/psacct start
 1040  Jan/22 - 15:32:06 lastcomm shrii
 1041  Jan/22 - 15:32:10 lastcomm root
 1042  Jan/22 - 15:32:38 lastcomm
 1043  Jan/22 - 15:32:48 lastcomm rm
 1044  Jan/22 - 15:32:51 lastcomm ls
 1045  Jan/22 - 15:32:53 lastcomm root
 1050  Jan/22 - 21:49:44 history

Monday, January 21, 2013

How To Lock/Unlock and Check The User In Linux.

## You can use this command to lock the User: shrii.

[root@localhost ~]# passwd -l shrii
Locking password for user shrii.
passwd: Success

##  This command shows you particular user status. If it is locked or unlock.

[root@localhost ~]# passwd -S shrii
shrii PS 2013-01-21 0 99999 7 -1 (Password set, MD5 crypt.)

## Using this command it will give you list.
[root@localhost ~]# cat /etc/passwd | cut -d : -f 1 | awk '{ system("passwd -S " $0) }' 

test PS 2012-12-27 0 99999 7 -1 (Password set, MD5 crypt.)
shrii PS 2013-01-21 0 99999 7 -1 (Password set, MD5 crypt.)
shrikant LK 2013-01-21 0 99999 7 -1 (Password locked.)
yo LK 2013-01-21 0 99999 7 -1 (Password locked.)

## Using the -u option you can unlock the user.
[root@localhost ~]# passwd -u shrii
Unlocking password for user shrii.
passwd: Success.

####### Another way to lock/unlock the user is "usermod".

## For Locking user.

usermod -L username

## for Unlocking the user.
usermod -U username

Friday, January 18, 2013

One Click Centralized Application Deployment With Webistrano.

One Click Centralized Application Deployment With Webistrano.

We mostly heard the name Hudson, Jenkin, Bamboo, etc. when we talk about application deployment. 

And above all mostly use for Java (For Continuous Integration). 
So what for Ruby on Rails, PHP, Wordpress, Magento, etc. yes we have best option and that is Webistrano. 
Its Open source and stable tool and if you utilize it properly for Application deployment you can have peace of mind and good sleep :) which is rare in this days. 
The back-end of Webistrano is most famous Capistrano. So yes its bug-less and rocking.

- User friendly and simple to use.

- Remote Multi-host deployment.
- One click and Centralize. 
- We can create Custom Recipes. 
- Much secure. 
- Deploy option with SVN and Git. 
- User Management. 
- Access Management. Limited Access for Developers who deploying application.
- Rollback option available. 
- you can deploy unlimited project in it. Same for Recipes, Host, Users.
- Its keeps history that no one can delete any more. 
- Interactive Deployment. So you can see and check the log what happening. 
- You can manage Min-Max Releases. 
- Failed build will never deploy on any server it just keep in history.
- Developers do not need to login to server any more. You can add task(recipes) for 
   checking logs Application and Apache etc. 
- Ready made default task available for Ruby on Rails.


- Project Wise Access. 
- Stage wise access available.  If you have Stage Environment Prod, Stage and Dev. You can 
  give access by stage wise. 
  Like:  For System admin – Prod.
            For Developers - Stage and Dev. 
- Read only Access also available for user.

Custom Recipes:
- You can add the Trigger After and Before deploy.

- It create the revision of recipes. So if we need older recipes we can have that any time in our
- If you have same environment for Staging, Production, Development you can use only one 
   recipe for all, No need to create individual recipes for each Stage. 

Manage Maintenance Page:
- By default there is recipes/task web-enable and web-disable 
   which is same Capistrano.
- You need to just made necessary entries is Apache Virtual Config and just run the task. 
- So you can add the web enable and web disable task in After and Before Trigger.
   So that it will run After and Before deployment.

Tips: If you using Capistrano you should try Webistrano and feel the Fun choose more