dmhs管理平台搭建
1、dmhs的源端 192.168.3.64 与目的端 192.168.3.58 已搭建完成,odbc驱动已配置完毕
管理平台使用另一台服务器192.168.3.78
2、oracle源端192.168.3.6配置dmhs_agent代理
在dmhs的安装目录下:例如/opt/dmhs/hs_agent/
vi dmhs_agent.xml
<?xml version="1.0" encoding="GB2312"?>
<hs_agent>
<lsn_port>5456</lsn_port>
<name>HsAgent</name>
<server_ip>192.168.3.64</server_ip> #本机IP
<status_interval>3</status_interval>
<status_server>192.168.3.78</status_server> #管理平台IP
<status_port>5236</status_port>
<status_user>SYSDBA</status_user>
<status_pwd>SYSDBA</status_pwd>
<dmhs_support>1</dmhs_support>
<veri_support>1</veri_support>
<lang>en</lang>
</hs_agent>
验证启动是否成功
[oracle@db01 hs_agent]$ ./DmhsAgentServiceHsAgent start
Starting DmhsAgentServiceHsAgent: [ OK ]
查看代理日志:
[oracle@db01 ~]$ cd /opt/dmhs/hs_agent/log
[oracle@db01 log]$ more dmhs_agent_202110.log
2021-10-21 16:57:05 HS_AGENT[INFO]: DMHS AGENT,V4.1.48-Build(2021.09.09-102088trunc)_D64
2021-10-21 16:57:05 HS_AGENT[INFO]: load guard_db_oci module…
2021-10-21 16:57:05 HS_AGENT[INFO]: Begin to register GUARD to VERI 192.168.3.78:5236.
2021-10-21 16:57:05 HS_AGENT[INFO]: DMHS AGENT Manage listening port:5456
2021-10-21 16:57:05 HS_AGENT[INFO]: DMHS AGENT IS READY.
——————————————————
3、达梦目的端192.168.3.58配置dmhs_agent代理
/opt/dmhs/hs_agent/
vi dmhs_agent.xml
<hs_agent>
<lsn_port>5456</lsn_port>
<name>HsAgent</name>
<server_ip>192.168.1.58</server_ip>
<status_interval>3</status_interval>
<status_server>192.168.1.77</status_server>
<status_port>5236</status_port>
<status_user>SYSDBA</status_user>
<status_pwd>SYSDBA</status_pwd>
<dmhs_support>1</dmhs_support>
<veri_support>1</veri_support>
<lang>en</lang>
</hs_agent>
[dmdba@dmdb hs_agent]$ ./DmhsAgentServiceHsAgent start
Starting DmhsAgentServiceHsAgent: [ OK ]
查看代理日志:
[dmdba@dmdb ~]$ cd /opt/dmhs/hs_agent/log/
[dmdba@dmdb log]$ more dmhs_agent_202110.log
2021-10-21 17:03:10 HS_AGENT[INFO]: DMHS AGENT,V4.1.48-Build(2021.09.09-102088trunc)_D64
2021-10-21 17:03:10 HS_AGENT[INFO]: load guard_db_oci module…
2021-10-21 17:03:10 HS_AGENT[INFO]: Begin to register GUARD to VERI 192.168.3.78:5236.
2021-10-21 17:03:10 HS_AGENT[INFO]: DMHS AGENT Manage listening port:5456
2021-10-21 17:03:10 HS_AGENT[INFO]: DMHS AGENT IS READY.
————————————dmhs_agent————
4、源端oracle,编辑hs代理脚本dmhs_agent.xml
[oracle@db01 hs_agent]$ vi dmhs_agent.xml
<hs_agent>
<lsn_port>5456</lsn_port>
<name>HsAgent</name>
<server_ip>192.168.3.64</server_ip>
<status_interval>3</status_interval>
<status_server>192.168.3.78</status_server>
<status_port>5236</status_port>
<status_user>SYSDBA</status_user>
<status_pwd>SYSDBA</status_pwd>
<dmhs_support>1</dmhs_support>
<veri_support>1</veri_support>
<lang>en</lang>
<hs_item>
<name>ORACLE</name>
<startup_flag>1</startup_flag>
<svr_name>DmhsService</svr_name>
<prog_dir>/opt/dmhs/bin</prog_dir>
<conf_path>/opt/dmhs/bin/dmhs.hs</conf_path>
<mgr_port>5345</mgr_port>
<check_interval>30</check_interval>
<auto_start_hs>0</auto_start_hs>
<try_times>0</try_times>
<stat>
<startup_flag>1</startup_flag>
<svr_name>DmhsStatService</svr_name>
<prog_dir>/opt/dmhs/bin/stat</prog_dir>
<conf_path>/opt/dmhs/bin/stat/dmhs_stat.xml</conf_path>
</stat>
</hs_item>
</hs_agent>
[dmdba@dmdb hs_agent]$ vi DmhsAgentServiceHsAgent
DMHS_HOME=/opt/dmhs
PROG_DIR=/opt/dmhs/hs_agent
CONF_PATH=/opt/dmhs/hs_agent/dmhs_agent.xml
NEED_LIB_PATH=/opt/dmhs/bin:/usr/lib/oracle/11.2/client64/lib:/usr/local/lib --很重要,加上NEED_LIB_PATH,oracle的ODBC驱动
[oracle@db01 hs_agent]$ ./DmhsAgentServiceHsAgent restart
Stopping DmhsAgentServiceHsAgent: [ OK ]
Starting DmhsAgentServiceHsAgent: [ OK ]
———————————dmhs_agent———————
5、达梦目的端,编辑hs代理脚本dmhs_agent.xml
[dmdba@dmdb ~]$ cd /opt/dmhs/hs_agent/
[dmdba@dmdb hs_agent]$ vi dmhs_agent.xml
<hs_agent>
<lsn_port>5456</lsn_port>
<name>HsAgent</name>
<server_ip>192.168.3.64</server_ip>
<status_interval>3</status_interval>
<status_server>192.168.1.78</status_server>
<status_port>5236</status_port>
<status_user>SYSDBA</status_user>
<status_pwd>SYSDBA</status_pwd>
<dmhs_support>1</dmhs_support>
<veri_support>1</veri_support>
<lang>en</lang>
<hs_item>
<name>DM</name>
<startup_flag>1</startup_flag>
<svr_name>DmhsService</svr_name>
<prog_dir>/opt/dmhs/bin</prog_dir>
<conf_path>/opt/dmhs/bin/dmhs.hs</conf_path>
<mgr_port>5345</mgr_port>
<check_interval>30</check_interval>
<auto_start_hs>0</auto_start_hs>
<try_times>0</try_times>
<stat>
<startup_flag>1</startup_flag>
<svr_name>DmhsStatService</svr_name>
<prog_dir>/opt/dmhs/bin/stat</prog_dir>
<conf_path>/opt/dmhs/bin/stat/dmhs_stat.xml</conf_path>
</stat>
</hs_item>
</hs_agent>
[dmdba@dmdb hs_agent]$ ./DmhsAgentServiceHsAgent restart
Stopping DmhsAgentServiceHsAgent: [ OK ]
Starting DmhsAgentServiceHsAgent: [ OK ]
———————————————stat—
6、oracle源端
[oracle@db01 ~]$ cd /opt/dmhs/bin/stat
[oracle@db01 stat]$ vi dmhs_stat.xml
<?xml version="1.0" encoding="GB2312"?>
<dmhs_stat>
<base>
<lang>en</lang>
</base>
<dmhs_conf>
<hs_xml_path>/opt/dmhs/bin/dmhs.hs</hs_xml_path>
<server_ip>192.168.3.64</server_ip>
<mgr_port>5345</mgr_port>
<startup_flag>2</startup_flag>
</dmhs_conf>
<stat_conf>
<stat_module_alive>1</stat_module_alive>
<module_alive_interval>30</module_alive_interval>
<stat_statistic>1</stat_statistic>
<statistic_interval>30</statistic_interval>
<stat_thr_info>1</stat_thr_info>
<thr_info_interval>30</thr_info_interval>
<stat_lag_info>1</stat_lag_info>
<lag_info_interval>30</lag_info_interval>
<stat_errlog>1</stat_errlog>
<stat_machine>1</stat_machine>
<machine_interval>30</machine_interval>
<save_sql>1</save_sql>
<stat_delay>30</stat_delay>
</stat_conf>
<database>
<db_server>192.168.1.78</db_server>
<db_port>5236</db_port>
<db_user>SYSDBA</db_user>
<db_pwd>SYSDBA</db_pwd>
</database>
</dmhs_stat>
[oracle@db01 stat]$ cp TemplateDmhsStatService DmhsStatService
[oracle@db01 stat]$ vi DmhsStatService
DMHS_HOME=/opt/dmhs
PROG_DIR=/opt/dmhs/bin/stat
CONF_PATH=/opt/dmhs/bin/stat/dmhs_stat.xml
#REPLACE need library path, LD_LIBRARY_PATH/LIBPATH
NEED_LIB_PATH=
HS_NLS_LANG=“AMERICAN_AMERICA.ZHS16GBK”
可在 log 目录查看日志文件
查看日志:
[oracle@db01 stat]$ more log/dmhs_stat_202110.log
———————————stat—————
7、[dmdba@dmdb ~]$ cd /opt/dmhs/bin/stat/
[dmdba@dmdb ~]$ vi dmhs_stat.xml
<?xml version="1.0" encoding="GB2312"?>
<dmhs_stat>
<base>
<lang>en</lang>
</base>
<dmhs_conf>
<hs_xml_path>/opt/dmhs/bin/dmhs.hs</hs_xml_path>
<server_ip>192.168.3.58</server_ip>
<mgr_port>5345</mgr_port>
<startup_flag>2</startup_flag>
</dmhs_conf>
<stat_conf>
<stat_module_alive>1</stat_module_alive>
<module_alive_interval>30</module_alive_interval>
<stat_statistic>1</stat_statistic>
<statistic_interval>30</statistic_interval>
<stat_thr_info>1</stat_thr_info>
<thr_info_interval>30</thr_info_interval>
<stat_lag_info>1</stat_lag_info>
<lag_info_interval>30</lag_info_interval>
<stat_errlog>1</stat_errlog>
<stat_machine>1</stat_machine>
<machine_interval>30</machine_interval>
<save_sql>1</save_sql>
<stat_delay>30</stat_delay>
</stat_conf>
<database>
<db_server>192.168.1.78</db_server>
<db_port>5236</db_port>
<db_user>SYSDBA</db_user>
<db_pwd>SYSDBA</db_pwd>
</database>
</dmhs_stat>
[dmdba@dmdb stat]$ cp TemplateDmhsStatService DmhsStatService
[dmdba@dmdb stat]$ vi DmhsStatService
DMHS_HOME=/opt/dmhs
PROG_DIR=/opt/dmhs/bin/stat
CONF_PATH=/opt/dmhs/bin/stat/dmhs_stat.xml
#REPLACE need library path, LD_LIBRARY_PATH/LIBPATH
NEED_LIB_PATH=
HS_NLS_LANG=“AMERICAN_AMERICA.ZHS16GBK”
可在 log 目录查看日志文件
[dmdba@dmdb stat]$ more log/dmhs_stat_202110.log
————————————————
8、管理平台tomcat部署
(已安装达梦数据库)
(1) 在源端或目的端/dmhs/script目录下 ,获取dmhs_manager.sql脚本
并在 管理平台数据库上运行
安装tomcat,本文使用版本为apache-tomcat-8.5.73.tar.gz
tar -zvxf apache-tomcat-8.5.73.tar.gz
mv apache-tomcat-8.5.73.tar.gz tomcat8
(2)删除/opt/tomcat8/webapps目录下的 manager文件
rm -rf /opt/tomcat8/webapps/manager
(3) 在源端或目的端/dmhs/web/webapps 目录下
将manager.war包传到管理平台的 /opt/tomcat8/webapps/ 目录
scp -r /dmhs/web/webapps/manager.war root@192.168.3.78:/opt/tomcat8/webapps/
(4) tomcat 配置信息
管理平台
vi /etc/profile
在文件最后面加上
export JAVA_HOME=/home/java/jdk1.8.0_311
export JRE_HOME=${JAVA_HOME}/jre
export CATALINA_HOME=/opt/tomcat8
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:${CATALINA_HOME}/bin:{CATALINA_HOME}/lib
export PATH=$PATH:${JAVA_PATH}:$PATH
上述JDK自行配制
(5) 在tomcat安装目录的bin目录下启动tomcat.
./startup.sh
管理平台浏览网址
http://IP(管理平台ip):8080/manager
http://192.168.3.78:8080/manager
(6)注意端口的开放!!!
目的端和源端都需要开放5345和5346端口:
firewall-cmd --zone=public --add-port=5345/tcp --permanent
firewall-cmd --zone=public --add-port=5346/tcp --permanent
firewall-cmd --reload
hsem管理平台服务器需要开放8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload