问题描述:
在redhat6.5(santiago)环境下,APM升级从14783升级到15006之后,启动卡在加载界面,并且通过 ps -aux|grep java 或者 ps -aux|grep postgres 无法找到相应的进程,推测是因为整个postgres数据库服务没有正常启动。
解决方法:
- 找一台能正常运行的15006版本的APM,将其<APM>/working/pgsql/data 下的amdb文件内容,复制到 服务器的amdb中。
- 根据下面内容,删除数据库中空白表,之后使用sh startPgsql.sh,尝试重启数据库;
14484以下的版本升级到15671版本,按照以下步骤进行操作: 1.升级前进行数据库备份及完整目录备份,如是虚拟机,进行快照备份 2.下载升级包,ManageEngine_Applications_Manager_15_0_SP-0_0_6.ppm和ManageEngine_Applications_Manager_15_0_SP-6_7_1.ppm 3.使用和安装APM时一样的用户进行升级,使用管理员打开CMD后执行updateManager.bat 4.按照以下链接中的方法对数据库进行维护 a.停止APM服务。使用shutdownApplicationsManager.bat shutdownApplicationsManager.bat -force停止 b.到安装目录working目录下执行bin\startPGSQL.bat。Note:在启动前,可以检查AMServer.properties和startPGSQL.bat看DB端口是否一致。 c.连接到数据库 https://pitstop.manageengine.com/portal/en/kb/articles/connecting-to-applications-managers-bundled-database AppManagerHome\working\pgsql\bin>set PGPASSWORD=appmanager AppManagerHome\working\pgsql\bin>psql -p 15432 -U postgres -h localhost -d amdb d. 执行 VACUUM FULL ANALYZE VERBOSE; Reindex database AMDB;(Linux环境中要执行) e.停止数据库,stopPGSQL.bat shutdownApplicationsManager.bat -force |
3.将旧的数据库(pgsql_9)的表,迁移到新的数据库(pgsql)
https://pitstop.manageengine.com/portal/en/kb/articles/connecting-to-applications-managers-bundled-database
Manual AppManager Database Migration: Before proceeding with the steps, check the port number for New and old Pgsql based on which the following commands needs to be changed New Pgsql(version10/11): Port = 15435 PgServerPath = <AppManager_home>\working\pgsql\bin Old Pgsql(version9): Port = 15436 PgServerPath = <AppManager_home>\working\pgsql_9\bin 1. Executed below commands using the right port number from the above step stop db server by executing the below commands in correct path Windows: <AppManager_home>\working\pgsql\bin>pg_ctl.exe -w -D ..\data\amdb -o -p15435 stop -s -m fast <AppManager_home>\working\pgsql_9\bin>pg_ctl.exe -w -D ..\data\amdb -o -p15436 stop -s -m fast Linux: <AppManager_home>/working/pgsql/bin$ ./pg_ctl -w -D ../data/amdb -o -p15435 stop -s -m fast <AppManager_home>/working/pgsql_9/bin$ ./pg_ctl -w -D ../data/amdb -o -p15436 stop -s -m fast 2. Then start db server by executing the below commands in correct path Windows: <AppManager_home>\working\pgsql\bin>pg_ctl.exe -w -D ..\data\amdb -o -p15435 start <AppManager_home>\working\pgsql_9\bin>pg_ctl.exe -w -D ..\data\amdb -o -p15436 start Linux: <AppManager_home>/working/pgsql/bin$ ./pg_ctl -w -D ../data/amdb -o -p15435 start <AppManager_home>/working/pgsql_9/bin$ ./pg_ctl -w -D ../data/amdb -o -p15436 start (If there is any permission issue, then give full permission to working directory of AppManager for all users on the server) 3. After stopping and starting the pgsql and created AMDB & necessary extensions by executing the below command indvidually: Windows: <AppManager_home>\working\pgsql\bin>set PGPASSWORD=appmanager <AppManager_home>\working\pgsql\bin>psql.exe -U postgres -p 15435 -h localhost postgres=#DROP DATABASE IF EXISTS amdb; postgres=#CREATE DATABASE amdb; postgres=#\c amdb; amdb=#CREATE EXTENSION "pgcrypto"; amdb=#CREATE EXTENSION CITEXT; amdb=#CREATE EXTENSION pg_stat_statements; amdb=#CREATE EXTENSION amcheck; amdb=#\q Linux: <AppManager_home>/working/pgsql/bin$ export PGPASSWORD=appmanager <AppManager_home>/working/pgsql/bin$ ./psql -U postgres -p 15435 -h localhost postgres=#DROP DATABASE IF EXISTS amdb; postgres=#CREATE DATABASE amdb; postgres=#\c amdb; amdb=#CREATE EXTENSION "pgcrypto"; amdb=#CREATE EXTENSION CITEXT; amdb=#CREATE EXTENSION pg_stat_statements; amdb=#CREATE EXTENSION amcheck; amdb=#\q 4. Now execute below commands: Windows: cd C:\Program Files (x86)\ManageEngine\AppManager13\working\pgsql_9\bin <AppManager_home>\working\pgsql_9\bin>set PGPASSWORD=appmanager <AppManager_home>\working\pgsql_9\bin>pg_dump.exe -U postgres -p 15436 -h localhost -c -x amdb | "C:\Program Files (x86)\ManageEngine\AppManager13\working\pgsql\bin\psql.exe" -U postgres -p 15435 -h localhost amdb Linux: cd /home/builds/ManageEngine/AppManager13/working/pgsql_9/bin <AppManager_home>/working/pgsql_9/bin$ export PGPASSWORD=appmanager <AppManager_home>/working/pgsql_9/bin$ ./pg_dump -U postgres -p 15436 -h localhost -c -x amdb | "/home/builds/ManageEngine/AppManager13/working/pgsql/bin/psql" -U postgres -p 15435 -h localhost amdb 5. after this execute stop db server commands Windows: <AppManager_home>\working\pgsql\bin>pg_ctl.exe -w -D ..\data\amdb -o -p15435 stop -s -m fast <AppManager_home>\working\pgsql_9\bin>pg_ctl.exe -w -D ..\data\amdb -o -p15436 stop -s -m fast Linux: <AppManager_home>/working/pgsql/bin$ ./pg_ctl -w -D ../data/amdb -o -p15435 stop -s -m fast <AppManager_home>/working/pgsql_9/bin$ ./pg_ctl -w -D ../data/amdb -o -p15436 stop -s -m fast Then started the AppManager as a service and check the issue |
4.重新启动pgsql数据库,基本上可以启动成功;
5.修改web端”全局配置”显示异常的问题;
APM升级到最新版本(目前看15671及15901版本都出现了这个问题),点击 设置-全局配置,并不能正常打开全局配置页面,可以在后台数据库中更新以下语句,并重启APM进行解决: update AM_GLOBALCONFIG set VALUE=0 where NAME='am.webclient.displaynamelength'; |