Friday, November 14, 2014

How to configure multiple REPO and update local repository via SRU on Solaris11


This article is about to create multiple REPO and update the local  REPO via SRU.
1. Download latest incremental repo SRU from oracle site.
2. Setting up the local system as a IPS Repository Server [HTTP interface]
3. Updating the local repository with incremental Solaris 11.1 SRU


Setting up the local system as a IPS Repository Server[HTTP interface]:

Since already I have a local repo configured in my server, so now just I am updating and enabling this repo as a HTTP interface. You can refer How to build REPO from the scratch (link - creating-ips-repository-on-solaris-11)

This is my local repo FS and current publisher status:
root@clnode1:~# df -h /repo
Filesystem             Size   Used  Available Capacity  Mounted on
repo                    20G   7.0G        13G    36%    /repo
root@clnode1:~#
root@clnode1:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///repo/
root@clnode1:~#
I have downloaded SRU ISO image in to my local disk and shared that folder. Now I am mounting shared folder as a /mnt mount point(Using OVM VBOX):
root@clnode1:~# mount -F vboxfs solaris /mnt
root@clnode1:~# df -h /mnt/
Filesystem             Size   Used  Available Capacity  Mounted on
solaris                233G   160G        73G    69%    /mnt
root@clnode1:~#
From /mnt mountpoint I am mounting SRU ISO as a /a mountpoint:
root@clnode1:~# lofiadm -a /mnt/SRU/sol-11_1_21_4_1-incr-repo.iso
/dev/lofi/1
root@clnode1:~# mkdir /a
root@clnode1:~# mount -F hsfs /dev/lofi/1 /a
root@clnode1:~# df -h /a
Filesystem             Size   Used  Available Capacity  Mounted on
/dev/lofi/1            3.9G   3.9G         0K   100%    /a
root@clnode1:~#
Unset existing publisher:
root@clnode1:/# pkg unset-publisher solaris
root@clnode1:/# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
root@clnode1:/#
Set publisher using IP address and port:
root@clnode1:/# pkg set-publisher -g 'http://192.168.10.11:81' solaris
root@clnode1:/# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://192.168.10.11:81/
root@clnode1:/#
Check the repo version :
root@clnode1:/# pkgrepo list -s http://192.168.10.11:81 | grep entire
solaris   entire           0.5.11,5.11-0.175.1.0.0.24.2:20120919T190135Z
root@clnode1:/#
To access client servers to this repo via HTTP we need to enable the application/pkg/server (SMF) service:
root@clnode1:/# svccfg -s application/pkg/server setprop pkg/inst_root=/repo
root@clnode1:/# svccfg -s application/pkg/server setprop pkg/port="81"
root@clnode1:/# svcs -a | grep -i /pkg/server
disabled        5:41:17 svc:/application/pkg/server:default
root@clnode1:/# svcadm enable svc:/application/pkg/server:default
root@clnode1:/# svcs pkg/server
STATE          STIME    FMRI
online          2:32:29 svc:/application/pkg/server:default
root@clnode1:/#
Updating the local repository with the incremental Solaris 11.1 SRU:
root@clnode1:/# pkgrecv -s /a/repo -d /repo '*'
Processing packages for publisher solaris ...
Retrieving and evaluating 783 package(s)...
PROCESS                                  ITEMS    GET (MB)   SEND (MB)
library/security/openssl                533/783   1445/3557   3066/8455
root@clnode1:/#
Building a Search Index:
root@clnode1:~# pkgrepo -s /repo refresh
Initiating repository refresh.
root@clnode1:~# 
Refresh and Restart the SMF service:
root@clnode1:~# svcadm refresh svc:/application/pkg/server
root@clnode1:~# svcadm restart svc:/application/pkg/server
root@clnode1:~# 
Verifying updated repo is available:
root@clnode1:~# pkgrepo list -s http://192.168.10.11:81 | grep entire
solaris   entire          0.5.11,5.11-0.175.1.21.0.4.1:20140701T165705Z
solaris   entire          0.5.11,5.11-0.175.1.0.0.24.2:20120919T190135Z
root@clnode1:~#
I can see the /repo FS got increased after update the repo:
root@clnode1:~# df -h /repo
Filesystem             Size   Used  Available Capacity  Mounted on
repo                    20G   8.2G        11G    43%    /repo
root@clnode1:~#
Cool... We have successfully upgraded LOCAL REPO using ISO image. 

Steps to Create Multiple REPO's: 
Above already we have created "solaris" REPO for OS packages. Now I am creating REPO for Solaris Cluster package. 
Mounting ISO REPO Image:
root@clnode1:~# df -h /mnt
Filesystem             Size   Used  Available Capacity  Mounted on
solaris                233G   162G        71G    70%    /mnt
root@clnode1:~# lofiadm -a /mnt/4.1/osc-4_1-ga-repo-full.iso
/dev/lofi/1
root@clnode1:~# mount -F hsfs /dev/lofi/1 /a
root@clnode1:~#
Setting up publisher for Solaris Cluster REPO: 
Check the publisher name:
root@clnode1:/# pkgrepo get -s /a/repo
SECTION    PROPERTY    VALUE
publisher  prefix      ha-cluster
repository description This\ repository\ serves\ a\ copy\ of\ the\ Oracle\ Solar                                                                                        is\ Cluster\ 4.1\ Package\ Repository.
repository name        Oracle\ Solaris\ Cluster\ 4.1\ Package\ Repository
repository version     4
root@clnode1:/#
Set publisher ha-cluster:
root@clnode1:~# pkg set-publisher -g file:///a/repo/ ha-cluster
root@clnode1:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://192.168.10.11:81/
ha-cluster                  origin   online F file:///a/repo/
root@clnode1:~#
To access client servers to this REPO via HTTP we need to create SMF service using application/pkg/server (SMF) service:
root@clnode1:/# svccfg -s pkg/server add ha-cluster
root@clnode1:/# svccfg -s pkg/server:ha-cluster setprop pkg/port=80
root@clnode1:/# svccfg -s pkg/server:ha-cluster setprop pkg/inst_root=/a/repo
root@clnode1:/# svccfg -s pkg/server list
:properties
default
ha-cluster
root@clnode1:/#
Refresh and enable ha-cluster SMF service:
root@clnode1:/# svcadm refresh application/pkg/server:ha-cluster
root@clnode1:/# svcadm enable application/pkg/server:ha-cluster
root@clnode1:/# svcs -a | grep -i ha-cluster
online          0:57:10 svc:/application/pkg/server:ha-cluster
root@clnode1:/#
Check the PORT status (we configured for REPO - 80 & 81):
root@clnode1:/# netstat -an | grep *.81
      *.81         *.*                0      0 128000      0 LISTEN
root@clnode1:/# netstat -an | grep *.80
      *.80         *.*                0      0 128000      0 LISTEN
root@clnode1:/#
Nice ... Successfully created multiple REPO and update local REPO.

0 comments:

Post a Comment