Tuesday, December 10, 2013

How to Upgrade Satellite

How to Upgrade Satellite
Reference

Prepare Satellite
1.      Download the ISO for 5.5 https://rhn.redhat.com/rhn/software/downloads/SupportedISOs.do  and upload it to satellite server.

2.       Login to Satellite and check if rhn-upgrade package is installed and make sure it’s at least version 5.5.0.18
a.       This system is receiving updates from RHN Classic or RHN Satellite.
b.      Installed Packages
c.       rhn-upgrade.noarch             5.5.0.18-1.el6sat             @redhat-rhn-satellite-5.4-server-x86_64-6
d.      If not installed, run yum install rhn-upgrade

3.       Read the README file in file /etc/sysconfig/rhn/satellite-upgrade/README

4.       Estimate how long the upgrade process will take by running the following command.
a.       [root@satellite1 satellite-upgrade]# cd /etc/sysconfig/rhn/satellite-upgrade
b.      # ./scripts/satellite-upgrade-estimates
Will you be upgrading both the operating system and the RHN Satellite? [N]

satellite-upgrade.txt, point 1:
* Command line part of RHN Satellite upgrade should take approximately: 00:40 (HH:MM)

satellite-upgrade.txt, point 2:
* Schema upgrade should take approximately: 00:10 (HH:MM)

5.       Since we are only upgrading Satellite and not the OS, read and follow this document.
a.       [root@satellite1 satellite-upgrade]# cat doc/satellite-upgrade.txt



Begin Satellite Upgrade
·         (satellite-upgrade.txt document)

1.       The following are instructions for upgrading from an RHN Satellite 5.2, 5.3 or 5.4 to 5.5 (no operating system upgrade).

2.       This upgrade is possible only if you have one of the following operating system and Satellite version combinations listed below:
·         - Red Hat Enterprise Linux 5 Server + Satellite 5.2
·         - Red Hat Enterprise Linux 5 Server + Satellite 5.3
·         - Red Hat Enterprise Linux 5 Server + Satellite 5.4
·         - Red Hat Enterprise Linux 6 Server + Satellite 5.4

3.       Basic step summary     ------------------
1.       Perform the command-line portion of the RHN Satellite Server 5.5 upgrade.
2.        Upgrade the database schema.
3.        Convert /var/satellite directory.
4.       Activate the RHN Satellite with the new RHN certificate.
§  Call into Red Hat Support for new cert.
5.        Rebuild search indexes.
6.       Enable (or re-enable) monitoring (and monitoring scout).
7.        Convert Cobbler kickstart profiles and snippets.
8.       Verify rhn.conf settings.
9.        Restart Satellite services.
Detailed upgrade steps   ----------------------
1.       Mount the RHN Satellite ISO and make sure the mounted ISO matches the operating system and architecture of the server you are installing it on.
a.       # mount -o loop -t iso9660 /home/tmtw1/satellite-5.5.0-20120911-rhel-6-x86_64.iso /mnt/media

2.       Perform the command-line portion of the RHN Satellite 5.5 upgrade. Run the install.pl command located in the root of the ISO (you may want to append --answer-file= option to the command in case you created an answer file in the preparation part):
a.           ./install.pl –upgrade
b.      ./install.pl --upgrade --skip-selinux-test --skip-fqdn-test
Or for disconnected Satellites:
c.           ./install.pl --upgrade –disconnected

3.       If you are using external Oracle database, append --external-db option to the installation command:    ./install.pl --upgrade --external-db
a.       Use defaults or make changes as needed.

4.       Upgrade the database schema.
a.       Create backup of your database. Should you have to repeat this step, you will use this backup to restore the database.
5.        At this point, none of the Satellite services other than the database should be running. To make sure, execute the following as root:
a.           /usr/sbin/rhn-satellite stop
b.          service oracle start            # embedded database only
c.        Make sure your undo and temporary tablespaces are at least 1 GB of size and your data tablespace has at least 10% of space available.
d.      Upgrade estimates should inform you whether you need a temporary tablespace larger than 1 GB.
e.      If you're using embedded database, use the db-control command to find out current sizes and to extend the tablespaces if necessary. If you're using external database, consult your DBA.
f.        Make sure your Oracle database is using cost based optimizer. If you're using embedded database, use the db-control command:
                                                              i.          su – oracle
                                                            ii.          db-control get-optimizer

                                                          iii.      If your embedded database is not using cost based optimizer, the above command will issue a warning message and instruct you to use db-control command to set your database optimizer to supported mode.
                                                           iv.      If you're using external database, consult your DBA.

6.       Create updated schema statistics. If using embedded database, login as oracle user:
a.        su – oracle
b.      And use db-control command to create schema statistics:    db-control gather-stats
c.       For external database, consult your DBA.

7.       Use spacewalk-schema-upgrade command to convert your Satellite schema. Execute the following as root:
a.        /usr/bin/spacewalk-schema-upgrade
b.      The command will put log files from the schema upgrade under:   /var/log/spacewalk/schema-upgrade
c.       The spacewalk-schema-upgrade command will inform you whether or not the schema upgrade successful.
d.      Should the schema upgrade fail because of insufficient space in some of the tablespaces, restore the database from backup, extend the tablespaces as needed and execute this step again.

8.       After a successful upgrade, check the version of upgraded schema:
a.        rhn-schema-version
b.      The schema version reported by the above command should match the version of installed satellite-schema package:
                                                              i.       rpm -q --qf '%{version}-%{release}\n' satellite-schema

9.       Convert /var/satellite directory.  This step is necessary if you are upgrading from Satellite 5.2. If you're upgrading from Satellite 5.3, this step can be safely skipped.
a.       Run update-packages script as root:    /usr/bin/update-packages --db=$(spacewalk-cfg-get default_db)  --update-filer   --update-kstrees  --debug
b.      The --debug option will direct the script to log all actions into /var/log/rhn/update-packages.log

10.    Activate the RHN Satellite. If this is a connected Satellite, run as root:
a.        rhn-satellite-activate  --rhn-cert <ABSOLUTE PATH TO *NEW* RHN CERT>  --ignore-version-mismatch
b.      If disconnected, run:    rhn-satellite-activate  --rhn-cert <ABSOLUTE PATH TO *NEW* RHN CERT> --disconnected  --ignore-version-mismatch

11.    Rebuild search indexes. Run as root:
a.        service rhn-search cleanindex
b.      This command will make rhn-search service clean search indexes and restart.

12.    Enable (or re-enable) monitoring (and monitoring scout):If you wish to enable (or re-enable) monitoring without enabling monitoring scout, run the following command as root:
a.       note: (only if monitoring module) we don’t have monitoring
b.       /usr/share/spacewalk/setup/upgrade/rhn-enable-monitoring.pl
c.       If you wish to enable (or re-enable) both monitoring and monitoring scout, run the following command:
d.      /usr/share/spacewalk/setup/upgrade/rhn-enable-monitoring.pl  --enable-scout

13.    Convert Cobbler kickstart profiles and snippets.  If you are upgrading from Satellite 5.4, you may safely skip this step. For a proper Cobbler 2.0 functionality, it is required to convert kickstart profiles and snippets. Run as root:
·         service httpd start
·         service cobblerd start
·         /etc/sysconfig/rhn/satellite-upgrade/scripts/upgrade-cobbler.sh
·         service httpd stop
·         service cobblerd stop

14.   Verify rhn.conf settings. A backup copy of rhn.conf and other configuration files were copied to /etc/sysconfig/rhn/backup-$DATE-$TIME. Referring to the backup copy of the rhn.conf file, please ensure that any previous custom values are set in the new RHN Satellite's /etc/rhn/rhn.conf file, such as:
a.        debug = 3
b.       pam_auth_service = rhn-satellite

15.    Restart Satellite services. Run as root:
a.       /usr/sbin/rhn-satellite restart
After the restart, Satellite may start rebuilding repodata for all synchronized channels. This will be a time consuming process (assume approximately 20 minutes for a single RHEL base channel.


Upgrade Process Screen Output

[root@satellite1 media]# ./install.pl --upgrade
* Starting the Red Hat Network Satellite installer.
* Performing pre-install checks.
Red Hat recommends SELinux be configured in either Permissive or Enforcing
mode for your RHN Satellite installation.  Run /usr/sbin/getenforce to see your
current mode.  If you wish to run in Disabled mode, re-run the installer with
the flag --skip-selinux-test.  When you install while SELinux is disabled and
want to enable SELinux later, run /usr/sbin/spacewalk-selinux-enable once
you've enabled SELinux, to run the post-installation steps which would
otherwise be run by the installer.
[root@satellite1 media]# ./install.pl --upgrade --skip-selinux-test
* Starting the Red Hat Network Satellite installer.
* Performing pre-install checks.
satellite1 doesn't have 3 fields (111.222.333). Can't be FQDN.
Use --skip-fqdn-test to bypass this error.
Exiting...
[root@satellite1 media]# ./install.pl --upgrade --skip-selinux-test --skip-fqdn-test
* Starting the Red Hat Network Satellite installer.
* Performing pre-install checks.
* Pre-install checks complete.  Beginning installation.
* RHN Registration.
** Registration: System is already registered with RHN.  Not re-registering.
* Upgrade flag passed.  Stopping necessary services.
* Purging conflicting packages.
* Checking for uninstalled prerequisites.
** Checking if yum is available ...
There are some packages from Red Hat Enterprise Linux that are not part
of the @base group that Satellite will require to be installed on this
system. The installer will try resolve the dependencies automatically.
However, you may want to install these prerequisites manually.
Do you want the installer to resolve dependencies [y/N]? y
* Applying updates.
* Installing RHN packages.
Warning: yum did not install the following packages:
        geronimo-specs-compat
* Now running spacewalk-setup.
* Setting up Oracle environment.
* Setting up database.
** Database: Upgrading the database server to latest Oracle 10g:
** Database: This is a long process that is logged in:
** Database: /var/log/rhn/upgrade_db.log
*** Progress: ##############################################################
** Database: Setting up database connection for Oracle backend.
** Database: Testing database connection.
** Database: Populating database.
** Database: Skipping database population.
* Setting up users and groups.
** GPG: Initializing GPG and importing key.
* Performing initial configuration.
* Activating RHN Satellite.
** Certificate not activated.
** Upgrade process requires the certificate to be activated after the schema is upgraded.
* Enabling Monitoring.
* Configuring apache SSL virtual host.
Should setup configure apache's default ssl server for you (saves original ssl.conf) [Y]?
* Configuring tomcat.
** /etc/tomcat6/tomcat6.conf has been backed up to tomcat6.conf-swsave
** /etc/tomcat6/server.xml has been backed up to server.xml-swsave
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file web.xml.rej
* Configuring jabberd.
* Creating SSL certificates.
** Skipping SSL certificate generation.
* Deploying configuration files.
* Update configuration in database.
* Setting up Cobbler..
cobblerd does not appear to be running/accessible
Cobbler requires tftp and xinetd services be turned on for PXE provisioning functionality. Enable these services [Y]?
cobblerd does not appear to be running/accessible
This portion of the RHN Satellite upgrade process has successfully completed.
Please refer to appropriate upgrade document in /etc/sysconfig/rhn/satellite-upgrade
for any remaining steps in the process.
 [root@satellite1 media]# rhn-satellite stop
Shutting down spacewalk services...
Stopping RHN Taskomatic...
RHN Taskomatic was not running.
Stopping cobbler daemon:                                   [FAILED]
Stopping rhn-search...
rhn-search was not running.
Shutting down osa-dispatcher:                              [FAILED]
Stopping httpd:                                            [FAILED]
Stopping tomcat6:                                          [  OK  ]
Shutting down Oracle Net Listener ...                      [  OK  ]
Shutting down Oracle DB instance "rhnsat" ...              [  OK  ]
Terminating jabberd processes ...
Stopping s2s:                                              [FAILED]
Stopping c2s:                                              [FAILED]
Stopping sm:                                               [FAILED]
Stopping router:                                           [FAILED]
Done.
[root@satellite1 media]# service oracle start
Starting Oracle Net Listener ...                           [  OK  ]
Starting Oracle DB instance "rhnsat" ...                   [  OK  ]
 [root@satellite1 media]# su - oracle
-bash-4.1$ db-control
-bash-4.1$ db-control report
Tablespace                  Size    Used   Avail   Use%
DATA_TBS                    6.8G    5.4G    1.4G    79%
SYSAUX                      500M    190M  309.9M    38%
SYSTEM                      400M  264.5M  135.5M    66%
TEMP_TBS                   1000M      0B   1000M     0%
UNDO_TBS                   1000M  357.3M  642.6M    36%
USERS                       128M     64K  127.9M     0%
-bash-4.1$ db-control get-optimizer
Database optimizer mode: ALL_ROWS
-bash-4.1$ db-control gathers-stats
No such command 'gathers-stats'; use 'help' to list available commands.
-bash-4.1$ db-control gather-stats
Gathering statistics...
WARNING: this may be a very slow process.
done.
 [root@satellite1 media]# spacewalk-schema-upgrade
Schema upgrade: [satellite-schema-5.4.0.20-1.el6sat] -> [satellite-schema-5.5.0.13-1.el6sat]
Searching for upgrade path: [satellite-schema-5.4.0.20-1] -> [satellite-schema-5.5.0.13-1]
Searching for upgrade path: [satellite-schema-5.4.0.20] -> [satellite-schema-5.5.0.13]
Searching for upgrade path: [satellite-schema-5.4.0] -> [satellite-schema-5.5.0]
Searching for upgrade path: [satellite-schema-5.4] -> [satellite-schema-5.5]
The path: [satellite-schema-5.4] -> [satellite-schema-5.5]
Planning to run spacewalk-sql with [/var/log/spacewalk/schema-upgrade/20130423-140545-script.sql]
Hit Enter to continue or Ctrl+C to interrupt:
Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/20130423-140545-to-satellite-schema-5.5.log].
The database schema was upgraded to version [satellite-schema-5.5.0.13-1.el6sat].
[root@satellite1 media]# rhn-schema-version
5.5.0.13-1.el6sat
[root@satellite1 media]# rpm -q --qf '%{version}-%{release}\n' satellite-schema
5.5.0.13-1.el6sat
 [root@satellite1 media]# rhn-satellite-activate --rhn-cert /root/mycompany.cert --ignore-version-mismatch
RHN_PARENT: satellite.rhn.redhat.com

[root@satellite1 media]# service rhn-search cleanindex
Stopping rhn-search...
rhn-search was not running.
Starting rhn-search...

# rhn-satellite restart
Shutting down spacewalk services...


No comments:

Post a Comment