This document explains how to restore services on a live H-Sphere system.
The recovery procedure should be performed in the following sequence:
I. Restore Software Configuration
Step 1. Download the Installer
- Download the installation scripts on your CP box if you don't have them downloaded:
wget http://www.psoft.net/shiv/HS/hsinst.tgz
- untar/ungzip the hsinst.tgz archive if you don't have them unzipped/untarred:
tar xfz ./hsinst.tgz
and cd into the installation directory:
cd ./hsinst
Step 2. Configuration
At this step, you will create configuration files.
- If your current H-Sphere hasn't been installed with the 2.3 installer,
collect your current H-Sphere configuration:
# ./import
- Launch the configuration wizard to enter installation data:
./configure
- In the configuration menu, check the ID of server you want to restore.
- Check if all services on this box are properly configured.
- Save the number of the server that you added a service on in the configuration menu.
- Save configuration and exit with '-' or 's'+'q' commands
- Execute:
make add-server-ID
where ID is the number of the server that you added the serivce on. This will
regenerate install configuration, upload install scripts to
this server and configure SSH keys to access it.
- Login to the server where you install the new service and execute:
cd /hsphere/install
1) If you have to re-install all services, type:
make install
2) If you need to install a particular service, type:
make add-service S=<SERVICE>
where <SERVICE> is be one of the following:
dns
mail
weblite
web
mysql
psql
|
DNS Server
Mail Server
Webmail server
Web server
MySQL server
PostgreSQL server
|
Resolving Conflicts in the System.
- If you have a mail server and want to add a web server:
- stop apache by running the following command:
- Linux: /etc/rc.d/init.d/httpd stop
- FreeBSD: /usr/local/etc/rc.d/apache.sh stop
- uninstall webmail apache rpm or package:
- Linux: rpm -e hsphere-apache-lite
- FreeBSD: pkg_delete `pkg_info | grep ^hsphere-apache-lite`
- If you want to add a mail server and don't have a web server, after
'make add-service S=mail' execute:
make add-service S=weblite
II. Run Recovery Tool
To restore your H-Sphere physical resources, run the PhysicalCreator Java utility
under the cpanel user:
# su - cpanel
bash-2.05a$ java psoft.hsphere.tools.PhysicalCreator [OPTIONS]
PhysicalCreator options:
-h|--help - shows the list of available options
-rg|--rgroup - resource group to perform operations on
The following resource groups are allowed:
unixweb - Unix virtual hosting resources
winweb - Windows virtual hosting resources
mysql - MySQL resources
mail - Mail resources
-co|--create-only - performs creation resources routines only
-do|--delete-only - performs delete resources routines only
-rc|--recreate - performs both delete and creation resources routines
-lid|--lserverId - process accounts on logical server with given number
-accs|--accounts - account IDs separated by comma
-st|--start-from - account ID. Process will start from this account ID
Important: Do not confuse the account ID with the server ID you have used in the
software configuration procedure! Account IDs could be found in the
accounts table of the H-Sphere system database.
For example, the entire command may look as follows:
bash-2.05a$ java psoft.hsphere.tools.PhysicalCreator -rg unixweb -co -lid 26
In this case, java will create:
- all home dirs with the default H-Sphere content;
- configuration of FTP and HTTP virtual hosts on unix logical server with ID 26.
This tool will only create/recreate the default content.
III. Restore User Content
Take the backed up
H-Sphere content and copy it back to the corresponding directories.
To restore databases, create them and then import data from the dump. For example,
if you have dumped all databases with pg_dumpall:
pg_dumpall > db.out
you restore all databases at once:
psql -f db.out template1
(Read man pg_dumpall for more details.)
|