DM8数据库安装,可以参考之前写的文章《达梦8数据库安装及日常维护(非图形化)》,这里省略数据库安装过程,DM8版本如下
SQL> select * from v$version;
行号 BANNER
---------- ---------------------------------
1 DM Database Server 64 V8
2 DB Version: 0x7000c
3 03134283890-20220720-165295-10045
关闭防火墙及开机自启
[root@dem WEB-INF]# systemctl stop firewalld.service
[root@dem WEB-INF]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
创建实例
[dmdba@dem bin]$ ./dminit path=/data db_name=DEM INSTANCE_NAME=DEMSVR port_num=5240 SYSDBA_PWD=DEMSYSDBA
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2023-07-20
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /data/DEM/DEM01.log
log file path: /data/DEM/DEM02.log
write to dir [/data/DEM].
create dm database success. 2023-02-21 19:20:40
配置dm.ini文件(可根据服务器配置调整)
MEMORY_POOL = 200
BUFFER = 500 #推荐值是1000
KEEP = 8 #推荐值是64
SORT_BUF_SIZE = 20 #推荐值是50
注册服务,启动服务
[root@dem root]# ./dm_service_installer.sh -t dmserver -dm_ini /data/DEM/dm.ini -p DEMSVR
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDEMSVR.service to /usr/lib/systemd/system/DmServiceDEMSVR.service.
创建服务(DmServiceDEMSVR)完成
[root@dem root]# systemctl start DmServiceDEMSV
配置DEM,在数据库中执行dem初始化SQL脚本
[dmdba@dem bin]$ ./disql SYSDBA/DEMSYSDBA:5240
SQL> set CHAR_CODE UTF8;
SQL> start /home/dmdba/dmdbms/web/dem_init.sql ;
安装java
[]root@dem ~]# tar -xvf jdk-8u361-linux-x64.tar.gz -C /usr/local
设置环境变量
[root@dem ~]# vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_361
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
安装tomcat
[root@dem ~]# tar -xvf apache-tomcat-8.5.85.tar.gz -C /usr/local
[root@dem ~]# cd /usr/local/apache-tomcat-8.5.85/bin/
解压dem.war在tomcat目录中,并修改相应配置文件
[root@dem web]# cd /usr/local/apache-tomcat-8.5.85/
[root@dem apache-tomcat-8.5.85]# cp /home/dmdba/dmdbms/web/dem.war webapps/
启动tomcat,启动后dem.war自动解压
root@dem apache-tomcat-8.5.85]# cd bin/
[root@dem bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.85
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.85
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.85/temp
Using JRE_HOME: /usr/local/jdk1.8.0_361/jre
Using CLASSPATH: /usr/local/apache-tomcat-8.5.85/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.85/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
修改数据库相关信息
[root@dem apache-tomcat-8.5.85]# cd dem/WEB-INF/
[root@dem WEB-INF]# vim db.xml
<?xml version="1.0" encoding="UTF-8"?>
<ConnectPool>
<Server>192.168.126.214</Server>
<Port>5240</Port>
<User>SYSDBA</User>
<Password>DEMSYSDBA</Password>
<InitPoolSize>5</InitPoolSize>
<CorePoolSize>10</CorePoolSize>
<MaxPoolSize>500</MaxPoolSize>
<KeepAliveTime>60</KeepAliveTime>
<DbDriver></DbDriver>
<DbTestStatement>select 1</DbTestStatement>
<SSLDir>../sslDir/client_ssl/SYSDBA</SSLDir>
<SSLPassword></SSLPassword>
</ConnectPool>
修改tomcat的server.xml 文件
[root@dem conf]# pwd
/usr/local/apache-tomcat-8.5.85/conf
[root@dem conf]# vim server.xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxPostSize= "-1" /> #添加这一行数据
修改JVM启动参数
[root@dem bin]# pwd
/usr/local/apache-tomcat-8.5.85/bin
[root@dem bin]# vim catalina.sh
# OS specific support. $var _must_ be set to either true or false.
JAVA_OPTS="-server -Xms512m -Xmx1024m -Djava.library.path=/home/dmdba/dmdbms/bin" #添加该行记录
配置tomcat服务开机自启
[root@dem ~]# cp /usr/local/apache-tomcat-8.5.85/bin/catalina.sh /etc/init.d/tomcatdem
[root@dem ~]# vim /etc/init.d/tomcatdem
#!/bin/sh
#chkconfig: 2345 10 90
#description:Dameng DEM Tomcat Service
CATALINA_HOME=/usr/local/apache-tomcat-8.5.85
JAVA_HOME=/usr/java/jdk1.8.0_361
JAVA_OPTS="-server -Xms256m -Xmx1024m -Djava.library.path=/home/dmdba/dmdbms/bin"
[root@dem ~]# chkconfig --add tomcatdem
[root@dem ~]# chkconfig --level 2345 tomcatdem on
[root@dem ~]# chkconfig --list tomcatdem
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
tomcatdem 0:off 1:off 2:on 3:on 4:on 5:on 6:off
重启tomcat服务
[root@dem ~]# /etc/init.d/tomcatdem stop
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.85
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.85
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.85/temp
Using JRE_HOME: /usr/local/jdk1.8.0_361/jre
Using CLASSPATH: /usr/local/apache-tomcat-8.5.85/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.85/bin/tomcat-juli.jar
Using CATALINA_OPTS:
[root@dem ~]# /etc/init.d/tomcatdem start
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.85
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.85
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.85/temp
Using JRE_HOME: /usr/local/jdk1.8.0_361/jre
Using CLASSPATH: /usr/local/apache-tomcat-8.5.85/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.85/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
访问DEM系统
浏览器输入以下网址登陆
http://192.168.126.214:8080/dem
账号密码:admin/888888
部署DEM代理(被监控节点配置)
[root@dm1 dmagent]# pwd
/home/dmdba/dmdbms/tool/dmagent
[root@dm1 dmagent]# vim agent.ini
center_url = http://192.168.126.214:8080/dem
指定 JAVA_HOME 路径(安装同DEM服务器安装步骤)
[root@dm1 ~]# vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_361
安装并启动代理
[root@dm1 ~]# cd /home/dmdba/dmdbms/tool/dmagent/
[root@dm1 dmagent]# ./service.sh install
The service DmAgentService is installed.
[root@dm1 dmagent]# ./service.sh start
Redirecting to /bin/systemctl start DmAgentService.service
多个节点操作同上
[root@dm2 dmagent]# ./service.sh install
input agent home [/home/dmdba/dmdbms/tool/dmagent] :
input agent.ini path [/home/dmdba/dmdbms/tool/dmagent/agent.ini] :
installation the service DmAgentService completed.
[root@dm2 dmagent]# ./service.sh start
Redirecting to /bin/systemctl start DmAgentService.service
[root@dm3 dmagent]# ./service.sh install
input agent home [/home/dmdba/dmdbms/tool/dmagent] :
input agent.ini path [/home/dmdba/dmdbms/tool/dmagent/agent.ini] :
installation the service DmAgentService completed.
[root@dm3 dmagent]# ./service.sh start
Redirecting to /bin/systemctl start DmAgentService.service
完成以上操作,在首页中点击资源管理进去可以看到刚刚添加到主机信息
点击下方的数据库后,再点击上方的添加,即可添加单实例或者集群的监控
这里以集群为例
选择站点
全部选择添加后确定
添加完成后大概是这样
以上是部署DEM的一个分享,关于tomcat和jdk下载可以查看以下链接,可根据系统版本选择
tomcat下载地址:https://tomcat.apache.org/download-80.cgi
jdk下载地址:https://www.oracle.com/java/technologies/downloads/#java8