準備工作
資料在達夢資料庫的安裝目錄的web目錄下以及網盤
注意:達夢資料庫的安裝路徑以及tomcat的解壓路徑不能含有中文(桌面位址也不行)否則會報各種錯
tomcat配置
修改日志編碼路徑
Tomcat安裝路徑的 conf包下
logging.properties
檔案,把utf-8編碼改成GBK(Window系統預設編碼)
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.encoding = GBK
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.encoding = GBK
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.encoding = GBK
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.encoding = GBK
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = GBK
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler
# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE
# To see debug messages in TldLocationsCache, uncomment the following line:
#org.apache.jasper.compiler.TldLocationsCache.level = FINE
# To see debug messages for HTTP/2 handling, uncomment the following line:
#org.apache.coyote.http2.level = FINE
# To see debug messages for WebSocket handling, uncomment the following line:
#org.apache.tomcat.websocket.level = FINE
修改server.xml
Tomcat安裝路徑的 conf包下
server.xml
檔案,新增
maxPostSize="-1"
屬性
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxPostSize="-1"
/>
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiI2EzX4xSZz91ZsAzNfRHLGZkRGZkRfJ3bs92YsAjMfVmepNHL90TQzVXalBHWhVWWyYUbhVUc1UDMTFWNKdVW1A1QiVTQClGVF5UMR9Fd4VGdsATNfd3bkFGazxycykFaKdkYzZUbapXNXlleSdVY2pESa9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnLxU2NjhzY1gDM1EGOmR2N5IGOyQTMhJmZhRjMmZjZiJ2Lc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
修改catalina.bat
Tomcat安裝路徑的bin目錄下修改
catalina.bat
檔案
## 217行的位置 字尾跟-Djava.library.path=D:\damba\dm8\bin 就是自己dm資料庫的安裝路徑
set "JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS%;-Djava.library.path=D:\damba\dm8\bin"
達夢資料庫配置
導入sql
在達夢的安裝目錄tool\dmagent下的
dem_init.sql
導入到資料庫中
修改war包中的位址
在 dem.war 中,解壓後在 tomcat 的路徑 webapps/dem/war/WEB-INI/db.xml 下中配置,改成war包連接配接資料庫的位址
修改dmagent.ini
在達夢的安裝目錄tool\dmagent下的dmagent.ini檔案
## 修改ip位址 就是tomcat項目部署以後的網址
center_url = http://127.0.0.1:8080/dem
#service
service_enable = true #whether enable
#gather
gather_enable = true
啟動Tomcat
驗證
假設部署 DEM 的機器 IP 為 localhost,則 DEM 通路位址:http://localhost:8080/dem/。預設使用者名和密碼:admin/888888。
.\start.bat D:\damba\dm8\tool\dmagent\agent.ini
有任何問題請到技術社群回報。
24小時免費服務熱線:400 991 6599
達夢技術社群:https://eco.dameng.com