Wednesday, July 10, 2013

Setting up the Subversion Sync between two Server (Primary-Secondary)


I assume that you have working Primary Subversion Server.  I also assume that you have new Subversion Server that would act as a Secondary Server. All the action should be done on Secondary Server.

Primary Server: https://svn.vaseem/svn/reponame/
Secondary Server: https://svn.vaseem2.com/svn/reponame/
     
1.  Create the repo (claimcolony) with the following command or by GUI
svnadmin create "C:\Repositories\reponame”
we can check the revision and other information by the following command
svn info https://svn.vaseem.com/svn/reponame/
Path: igdbatchtool
URL: https://svn.vaseem/svn/xyzrepo
Repository Root: https://svn.vaseem/svn/xyzrepo
Repository UUID: aaac7bac-4d54-a44b-87f7-7681aaadcd9b
Revision: 0
Node Kind: directory
Last Changed Rev: 0
Last Changed Date: 2012-07-06 05:55:11 -0700 (Fri, 06 Jul 2012)
   
2.  Check the UUID of created repo with
svn info https://svn.vaseem/svn/xyzrepo/

set the same UUID for the newly created repo as of Primary repo by command

svnadmin setuuid  /path/of/repo/  UUID of Primary repo
svnadmin setuuid "D:\Repositories\xyzrepo" db5423f0-d7e9-4b4a-b701-935fb5d42e4b
     
3.  Initialize the sync from Primary repository by the below command
svnsync initialize DEST_URL SOURCE_URL
this will throw errors so we need to go to the mirror (secondary) repo and need to change the pre-revporp-change hook to change so that it can accept the change



















Now initialize the sync for repository
svnsync initialize DEST_URL SOURCE_URL
svnsync initialize https://svn.vaseem.com/svn/xyzrepo/
https://svn.vaseem2.com/svn/xyzrepo/

Now start sync
svnsync sync DEST_URL SOURCE_URL

svnsync sync https://svn.vaseem.com/svn/xyzrepo/
https://svn.vaseem2.com/svn/xyzrepo/
this will start syncing…





JIRA Installation and Configuration


Step 1. Installation postgresql 

yum install postgresql postgresql-server

[root@TPAEXZSLRD01 opt]# yum install postgresql postgresql-server
Loaded plugins: fastestmirror, security
Determining fastest mirrors
 * base: mirror.us.leaseweb.net
 * extras: mirror.umd.edu
 * updates: mirror.cs.vt.edu
base                                                                                                                  | 3.7 kB     00:00
base/primary_db                                                                                                       | 4.4 MB     00:05
extras                                                                                                                | 3.5 kB     00:00
extras/primary_db                                                                                                     |  19 kB     00:00
updates                                                                                                               | 3.5 kB     00:00
updates/primary_db                                                                                                    | 2.5 MB     00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql.x86_64 0:8.4.13-1.el6_3 will be installed
--> Processing Dependency: postgresql-libs(x86-64) = 8.4.13-1.el6_3 for package: postgresql-8.4.13-1.el6_3.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql-8.4.13-1.el6_3.x86_64
---> Package postgresql-server.x86_64 0:8.4.13-1.el6_3 will be installed
--> Running transaction check
---> Package postgresql-libs.x86_64 0:8.4.13-1.el6_3 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
 Package                                 Arch                         Version                               Repository                  Size
=============================================================================================================================================
Installing:
 postgresql                              x86_64                       8.4.13-1.el6_3                        base                       2.8 M
 postgresql-server                       x86_64                       8.4.13-1.el6_3                        base                       3.4 M
Installing for dependencies:
 postgresql-libs                         x86_64                       8.4.13-1.el6_3                        base                       200 k

Transaction Summary
=============================================================================================================================================
Install       3 Package(s)

Total download size: 6.4 M
Installed size: 29 M
Is this ok [y/N]: Y
Downloading Packages:
(1/3): postgresql-8.4.13-1.el6_3.x86_64.rpm                                                                           | 2.8 MB     00:02
(2/3): postgresql-libs-8.4.13-1.el6_3.x86_64.rpm                                                                      | 200 kB     00:00
(3/3): postgresql-server-8.4.13-1.el6_3.x86_64.rpm                                                                    | 3.4 MB     00:02
---------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                        1.1 MB/s | 6.4 MB     00:05
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : postgresql-libs-8.4.13-1.el6_3.x86_64                                                                                     1/3
  Installing : postgresql-8.4.13-1.el6_3.x86_64                                                                                          2/3
  Installing : postgresql-server-8.4.13-1.el6_3.x86_64                                                                                   3/3
  Verifying  : postgresql-server-8.4.13-1.el6_3.x86_64                                                                                   1/3
  Verifying  : postgresql-libs-8.4.13-1.el6_3.x86_64                                                                                     2/3
  Verifying  : postgresql-8.4.13-1.el6_3.x86_64                                                                                          3/3

Installed:
  postgresql.x86_64 0:8.4.13-1.el6_3                                postgresql-server.x86_64 0:8.4.13-1.el6_3

Dependency Installed:
  postgresql-libs.x86_64 0:8.4.13-1.el6_3

Complete!
[root@TPAEXZSLRD01 opt]# chkconfig postgresql on
[root@TPAEXZSLRD01 opt]# service postgresql start

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
                                                           [FAILED]
[root@TPAEXZSLRD01 opt]# ^C
[root@TPAEXZSLRD01 opt]# service postgresql initdb
Initializing database:                                     [  OK  ]
[root@TPAEXZSLRD01 opt]#service postgresql start
Starting postgresql service:                               [  OK  ]
[root@TPAEXZSLRD01 opt]# vim /etc/sysconfig/iptables
[root@TPAEXZSLRD01 opt]# /etc/init.d/iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:



CREATE USER jirauser WITH PASSWORD 'password';

CREATE DATABASE jiradb;

GRANT ALL PRIVILEGES ON DATABASE jiradb to jirauser;


Error connecting to database

FATAL: Ident authentication failed for user "jirauser"

#vim /var/lib/pgsql/data/pg_hba.conf

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
host    all         all        10.10.0.2 255.255.255.0 trust
# IPv6 local connections:
#host    all         all         ::1/128               md5
host all all 0.0.0.0 0.0.0.0 trust



Step 2: Installation of JIRA

This will install JIRA 4.4.1 on your computer.
OK [o, Enter], Cancel [c]

If JIRA is already installed on this machine, please read the following information carefully.
Please choose between creating a new JIRA installation or upgrading an
existing JIRA installation.
Create a new JIRA installation. [1, Enter], Upgrade an existing JIRA installation. [2]
2
Existing JIRA installation directory:
[/opt/JIRA]

No directory found in specified location
Finishing installation ...
[root@moscow opt]# ./atlassian-jira-4.4.1-x32.bin
Unpacking JRE ...
Starting Installer ...

This will install JIRA 4.4.1 on your computer.
OK [o, Enter], Cancel [c]

If JIRA is already installed on this machine, please read the following information carefully.
Please choose between creating a new JIRA installation or upgrading an
existing JIRA installation.
Create a new JIRA installation. [1, Enter], Upgrade an existing JIRA installation. [2]
1

Where should JIRA 4.4.1 be installed?
[/opt/atlassian/jira]

Default location for JIRA data
[/var/atlassian/application-data/jira]

Configure which ports JIRA will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access JIRA
through your browser. The Control port is used to Startup and Shutdown JIRA.
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]

JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start
automatically whenever the computer restarts.
Install JIRA as Service?
Yes [y, Enter], No [n]
y

Extracting files ...


Please wait a few moments while JIRA starts up. Depending on your system this may take a few minutes.
Launching JIRA ...

Setup has finished installing JIRA 4.4.1 on your computer.
JIRA 4.4.1 can be accessed at http://localhost:8080
Finishing installation ...

Step 3: Configuration of JIRA

Launch the browser and access the JIRA: http://localhost:8080





























Resizing the disk space on Linux VMs running on VMware ESXi 5

Step1:

Connect to your ESXi Server and switch off the machine running on ESXiEdit the disk and increased the desired size and reboot the machine.




Step 2:


Now this machine is up and running and having the unallocated disk space, we need to use this

Login to machine via ssh


List the disk partition


# fdisk -l /dev/sda


Disk /dev/sda: 171.8 GB, 171798691840 bytes

255 heads, 63 sectors/track, 20886 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b5bc9

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13055   104344576   8e  Linux LVM

so the disk have two partition /dev/sda1 and /dev/sda2

Create new partition

#fdisk /dev/sda

type n - to create a new partition
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
type p - for primary partition
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
We already have /dev/sda1 and /dev/sda2 Press ’3′ for this new partition which will be created as /dev/sda3
Partition number (1-4): 3
Just press enter twice above as by default the first and last cylinders of the unallocated space should be correct. After this the partition is then ready.
First cylinder (3211-4456, default 2611): "enter"
Using default value 4456
Last cylinder, +cylinders or +size{K,M,G} (3211-4456, default 4456): "enter"
Using default value 4456
Command (m for help): t
Partition number (1-5): 3
type 8e - for the "Linux LVM" type
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
type w - to write changes and exit
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

Now Reboot the machine
Increasing the logical volume

We use the pvcreate command which creates a physical volume for later use by the logical volume manager (LVM). In this case the physical volume will be our new /dev/sda3 partition.
# pvcreate /dev/sda3
let's now create the physical volume in that partition:

# pvcreate /dev/sda3
Now let's extend the server's Volume Group to that physical volume.

# vgdisplay

Note down the entry next to "VG Name". That's your Volume Group name.


# vgextend EnterVolumeGroupNameHere /dev/sda3


#####

If you get a message saying /dev/sda3 could not be added to your Volume Group, you need to remove the physical volume and recreate it. Metadata might have gotten corrupt and thus the volume cannot be added to your Volume Group. So just do:

# pvremove /dev/sda3

And then again:

# pvcreate /dev/sda3

#####


Since we're (essentially) extending the main logical volume, let's get the name of that:

# lvdisplay

and note down the entry next to "LV Name". This is your logical volume's name (e.g. /dev/srv/root), which you'll now extend to the newly added partition/physical volume.


- Extend the logical volume by X GBs:

# lvextend -L +XG yourLogicalVolumeName
Make sure you replace X above with the actual number of GBs you've added in your VM's settings. So if you increased your VM by 20GBs, the command becomes:

# lvextend -L +20G yourLogicalVolumeName


Finally, let's resize the file system to the new allocated space:

$ resize2fs yourLogicalVolumeName

(this may take some time depending on number of GBs added to the file system.


- Check the new file system sizes:

# df -hT


This is all done.