redhat环境下,AppManager从14783版本升级到15006后,启动问题

问题描述:

在redhat6.5(santiago)环境下,APM升级从14783升级到15006之后,启动卡在加载界面,并且通过 ps -aux|grep java 或者 ps -aux|grep postgres 无法找到相应的进程,推测是因为整个postgres数据库服务没有正常启动。

解决方法:

  1. 找一台能正常运行的15006版本的APM,将其<APM>/working/pgsql/data 下的amdb文件内容,复制到 服务器的amdb中。
  2. 根据下面内容,删除数据库中空白表,之后使用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';

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值