Friday, March 1, 2013

R1soft Installation

Installing CDP server (On Backup Server)

USING YUM :-
Login to the backup server.
cd /etc/yum.repos.d
vi r1soft.repo

Insert the following text into the file and save the file:

[r1soft]
name=R1Soft Repository Server
baseurl=http://repo.r1soft.com/yum/stable/$basearch/
enabled=0
gpgcheck=0

yum install r1soft-cdp-enterprise-server --enablerepo=r1soft
(wont work now since r1soft chnaged its rpm names so try below command)
OR
yum install serverbackup-enterprise-server --enablerepo=r1soft

USING RPM
Login to the backup server.
Check whether any rpm for r1soft is installed on the server
rpm -qa |grep r1soft

Check the server archetecture and download the zip file.
wget http://repo.r1soft.com/release/trials/R1Soft-EnterpriseEdition-linux32.zip
wget http://repo.r1soft.com/release/trials/R1Soft-EnterpriseEdition-linux64.zip

Unzip the file.
unzip R1Soft-EnterpriseEdition-linux64.zip
cd enterprise-rpm

Install all the rpm files.
rpm -i *.rpm

Configure and Start the CDP Server Web-based User Interface
Use r1soft-setup to configure r1soft
r1soft-setup --help

Run the following command with admin username and password.
r1soft-setup --user DESIRED_USERNAME --pass DESIRED_PASSWORD

Restart the CDP server
/etc/init.d/cdp-server restart

Assign ports for http and https.
r1soft-setup --http-port 8080 --https-port 8443
/etc/init.d/cdp-server restart
Location of server Key file /usr/sbin/r1soft/conf/server.allow/127.0.0.1

======================================================================
Installing CDP agent (On Client Server)
USING YUM
Login to the data server.
cd /etc/yum.repos.d
vi r1soft.repo

Insert the following text into the file and save the file:
[r1soft]
name=R1Soft Repository Server
baseurl=http://repo.r1soft.com/yum/stable/$basearch/
enabled=0
gpgcheck=0

yum install r1soft-cdp-enterprise-agent --enablerepo=r1soft
OR
yum install serverbackup-enterprise-agent --enablerepo=r1soft
USING RPM
rpm -qa |grep r1soft
wget http://repo.r1soft.com/release/trials/R1Soft-EnterpriseEdition-linux32.zip
wget http://repo.r1soft.com/release/trials/R1Soft-EnterpriseEdition-linux64.zip
unzip R1Soft-EnterpriseEdition-linux64.zip

If it is 64 bit, then
cd rpm-linux64/
rpm -i *.rpm
If it is 32 bit, then
cd rpm-linux32/
rpm -i *.rpm

make sure that port 8443 & 1167 are allowed in the csf.
Configure and Start the CDP Agent Web-based User Interface
Enter the following command to get key from the CDP server.
r1soft-setup --get-key https://IP_of_CDP_server:

Configure My.cnf
vi /etc/my.cnf
add
[mysqld_safe]
basedir=/usr
Restart MySQL
/etc/init.d/mysql restart
Adding hcpdriver kernel module for R1Soft
Check kernel version
uname -r
check hcpdriver is present in /lib/modules/r1soft/
ll /lib/modules/r1soft/
If present, check the it has the same version of current running kernel as follows.
--------
[root@angel ~]# ll /lib/modules/r1soft/
total 76
-rw-r--r-- 1 root root 69658 Jan 30 2011 hcpdriver-cki-2.6.35.10-19.ko
lrwxrwxrwx 1 root root 49 Apr 7 11:13 hcpdriver.o -> /lib/modules/r1soft/hcpdriver-cki-2.6.35.10-19.ko
[root@angel ~]# uname -r
2.6.35.10-19
[root@angel ~]#
--------
Creating a new hcpdriver.ko when a new kernel is compiled.
When we compile a kernel, we need to create the hcpdriver from the same server where kernel is compiled and rpm is made. We have to use the build directory of the kernel compilation where all the necessary build details for creating the kernel modules lie. For example, we have compiled a kernel 3.3.3D in the server proton. The kernel will be created in the path /usr/src/redhat/RPMS/x86_64/kernel-3.3.3D-1.x86_64.rpm and the corresponding build directory will be formed at /usr/src/redhat/BUILD/kernel-3.3.3D. When we install the kernel rpm in the same server, a link will be created to this build directory like follows.
root@newsrv [/]# ls -al /lib/modules/3.3.3D/build
lrwxrwxrwx 1 root root 35 Jun 19 04:28 /lib/modules/3.3.3D/build -> /usr/src/redhat/BUILD/kernel-3.3.3D
If we install this kernel rpm on a different server, a similar link will be created but there will be no build directory /usr/src/redhat/BUILD/kernel-3.3.3D. For example see izzy server
root@izzy [~]# ll /lib/modules/3.3.3D/build
lrwxrwxrwx 1 root root 35 Jun 23 02:25 /lib/modules/3.3.3D/build -> /usr/src/redhat/BUILD/kernel-3.3.3D

root@izzy [~]# ll /usr/src/redhat/BUILD/kernel-3.3.3D
/bin/ls: /usr/src/redhat/BUILD/kernel-3.3.3D: No such file or directory
So, we need to compile a custom kernel module from the server where the rpm is created. Lets compile hcpdriver. Make a directory /usr/src/3.3.3Dhcp and give it as the dest dir. hcpdriver will be formed there.
mkdir /usr/src/3.3.3Dhcp
root@newsrv [/etc/yum.repos.d]# r1soft-setup --get-module --kernel-dir /lib/modules/3.3.3D/build --dest /usr/src/3.3.3Dhcp/
Checking for binary module
Waiting |
No binary module found
Gathering kernel information
Gathering kernel information complete.
Creating kernel headers package
Checking '/lib/modules/3.3.3D/build' for kernel headers
Found headers in '/lib/modules/3.3.3D/build'
Compressing...
uploading kernel package 99% 33MB 3.5MB/s 00:00 ETA
Starting module build...
Complete.
Saving kernel module to '/usr/src/3.3.3Dhcp//hcpdriver-cki-3.3.3D.ko'
Kernel module is now installed.
Use '/etc/init.d/cdp-agent restart' to load the new driver

You can use this hcpdriver-cki-3.3.3D.ko on all servers where you are installing kernel 3.3.3D. Copy this to the staffbox server /home/download/kernel/generic. Create a symlink for the .ko file to hcpdriver.ko, so that it looks like below. Now anyone can download the hcpdriver you created.
[root@im generic]# ll /home/download/kernel/generic/hcpdriver.ko
lrwxrwxrwx 1 root root 23 Jun 24 06:18 /home/download/kernel/generic/hcpdriver.ko -> hcpdriver-cki-3.3.3D.ko
Configuring hcpdriver on a server.
For 64bit servers, Download the hcpdriver to the path /lib/modules/r1soft/
Note the file downloaded, make a sylimk for hcpdriver.o for the file downloaded.
root@izzy [~]# ll /lib/modules/r1soft/hcpdriver.o
lrwxrwxrwx 1 root root 43 Jun 24 07:58 /lib/modules/r1soft/hcpdriver.o -> /lib/modules/r1soft/hcpdriver-cki-3.3.3D.ko
Restart cdp-agent
/etc/rc.d/init.d/cdp-agent start
See if it lists in lsmod
root@izzy [~]# lsmod | grep -i hcpdriver
hcpdriver 571990
You are Done !!


In openVZ node, fisrt install kernel-devel and then try r1soft-setup --get-module
yum install kernel-devel-$(uname -r) -y
r1soft-setup --get-module
OR
Use RPM to install kernel-devel
rpm -ivh http://download.openvz.org/kernel/branches/rhel6-2.6.32/042stab053.5/vzkernel-devel-2.6.32-042stab053.5.x86_64.rpm
r1soft-setup --get-module

Take the interface from browser
http://IP:8080
Enter using username & password.
Now you can add the agent to the CDP server and can create volume and disk safe and also the policies and schedule backup.

No comments:

Post a Comment