Sometimes it may be necessary to uninstall/reinstall PostgreSQL software e.g. errors during initial APM install, moving APM database to a new server etc.
In what follows the default installation folder hierarchy of C:\Program Files\CA APM is assumed with APM 9.5 installation folder of C:\Program Files\CA APM\Introscope188.8.131.52.
Modify as necessary for actual installation folder.
- Make any necessary database backups of any existing Postgres APM Database.
- Shutdown all Enterprise Managers (EM) in the cluster.
- Go to Control Panel -> Programs and Features
Uninstall the Postgres software PostgreSQL 8.4
- Go to Control Panel -> Administrative Tools -> Services
Check that the postgres service pgsql-8.4 no longer exists
- Go to Control Panel -> Administrative Tools -> Computer Management -> Local Users and Groups
Delete the user postgres.
- Delete or rename this directory: C:\Program Files\CA APM\database
- Rename any existing APM "install" folder for the installation process e.g. C:\Program Files\CA APM\Introscope184.108.40.206\install
- Run APM installer
- Select the "Database Only" option
- "Target Installation directory" - use the existing APM installation folder or create new (C:\Program Files\CA APM\Introscope220.127.116.11). If it already exists you will be asked to confirm.
- Select PostgreSQL
- Select "Install Database"
- "Target Installation directory for the database" - use default C:\Program Files\CA APM\database
The Postgres administrator password is used both for database administrator and the Windows user postgres that runs the service.
The user admin is the default owner of the APM database (cemdb). Use the same password for admin as you did when you ran any previous EM installs so that the EM configuration file EM_HOME\config\tess-db-cfg.xml file already has the correct/matching credentials.
- If the installer reports any errors refer to the new log files in folder C:\Program Files\CA APM\Introscope18.104.22.168\install e.g. schematools.log.
- Follow these steps to verify the Postgres server is running and can be connected from any remote location EM servers:
- Control Panel -> Administrative Tools -> Services. Check postgres service pgsql-8.4 is started.
- Run this command to check that Postgres server is listening on its default port of 5432: netstat -na | find "5432" |find "LISTENING"
1 or 2 lines should be returned e.g.
TCP 0.0.0.0:5432 0.0.0.0:0 LISTENING TCP [::]:5432 [::]:0 LISTENING
- Download & run the pgAdmin utility (http://www.pgadmin.org) on remote EM servers. Connect to the new Postgres server to verify successful connection and no firewall problems with blocking on port 5432. Alternatively "telnet postgres_server 5432" command can also be used to check for any firewall problems (no connection refused message indicates success)
- Restore any database backup. If the backup is for a version of APM prior to the new version being installed then the "REINSTALL steps" should be run again but for step (d) select "Upgrade database schema ..." and then proceed with upgrading the restored database.
- Restart all EMs in the cluster.
- Assuming the file C:\Program Files\CA APM\Introscope22.214.171.124\config\tess-db-cfg.xml has the correct admin password already, MOM and Collectors should be able to connect successfully to the new database.
- To verify correct database settings/connectivity for the MOM login to the CEM UI: http://MOM_server:8081/wily/cem/tess/app/login.html
Go to System->Database Settings and run "Test Connection"
If the connection encounters an error you can modify the password for the user name admin to match what was used in the Postgres reinstall step.
Any changes made will be updated in the relevant config file C:\Program Files\CA APM\Introscope126.96.36.199\config\tess-db-cfg.xml on the MOM.
- If there is still a problem with the Collector's connections to the database e.g. Collector log file IntroscopeEnterpriseManager.log contains PSQLException errors due to failed database connection, the CEM UI->Setup->Services page only shows a MOM in the EM list (one or more missing Collectors)
- Stop all Collectors.
- Copy file C:\Program Files\CA APM\Introscope188.8.131.52\config\tess-db-cfg.xml from the MOM to each Collector.
Make any necessary modifications to tess-db-cfg.xml to ensure that the correct hostname or IP Address is used for the Postgres server (postgres_server) in the JDBC URL property because if the MOM is on the same server as Postgres that value is often set to 127.0.0.1 i.e.
Change: <property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/cemdb</property>
To: <property name="hibernate.connection.url">jdbc:postgresql://postgres_server:5432/cemdb</property>
- Restart all Collectors and recheck the IntroscopeEnterpriseManager.log file and CEM UI->Setup->Services page.