# DemInstall **Repository Path**: zklall/dem-install ## Basic Information - **Project Name**: DemInstall - **Description**: dem一键安装脚本 - **Primary Language**: Shell - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-10-10 - **Last Updated**: 2026-01-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DM DEM Installation Script Version: 1.0 This script automates the installation process for DM Database Enterprise Manager (DEM). ## Prerequisites ### Required Files Before running the installation script, ensure you have the following files placed in the appropriate locations: 1. **DEM Package** - File pattern: `dem_*.zip` or `dem-*.zip` - Location: Base installation directory (same directory as install_dem.sh) - Example: `dem_v7.8.0_xxx.zip` 2. **Tomcat Package** - File pattern: `apache-tomcat-*.zip` - Location: Base installation directory - Example: `apache-tomcat-9.0.xx.zip` 3. **DM Agent Package** - File pattern: `dmagent-*.zip` - Location: Base installation directory or `dmagent/` directory - Example: `dmagent-7.8.0.zip` ### Database Requirements - DM Database server must be running and accessible - Database user with appropriate privileges - Database instance ready for DEM installation ## Installation Steps Overview The script performs the following steps in sequence: 0. **Check port occupancy** - Verify all required ports are available 1. **Initialize metadata database** - Create DEM database instance 2. **Register service** - Register database service 3. **Start metadata database service** - Start the database service 4. **Extract DEM package** - Extract DEM package files 5. **Initialize metadata database table structure** - Create DEM database schema and tables 6. **Extract tomcat package** - Extract Tomcat package 7. **Modify tomcat's catalina.sh file** - Add JAVA_OPTS configuration 8. **Modify tomcat's server.xml** - Update port, address, and maxPostSize settings 9. **Deploy dem.war file** - Deploy dem.war to Tomcat webapps 10. **Start Tomcat service once and stop** - Initial startup to generate configuration files 11. **Modify database connection configuration** - Update database connection settings 12. **Start Tomcat again** - Start Tomcat service 13. **Configure and start dmagent** - Configure and start DM Agent service ## Usage ### Command Line Parameters The script supports the following command line parameters: ```bash ./install_dem.sh [options] Options: --port-num Database port (default: 5239) --sysdba-pwd SYSDBA password (default: Test_dameng123) --sysauditor-pwd SYSAUDITOR password (default: Test_dameng123) --tomcat-port Tomcat port (default: 8080) --dem-url DEM access URL (default: http://127.0.0.1:8080/dem) --install-service-key Installation service key (default: 999999) --agent-serviceport Agent service port (default: 6363) --agent-apport Agent app port (default: 6364) --help Show this help message ``` ### First-time Installation ```bash ./install_dem.sh ``` ### Installation with Custom Parameters ```bash ./install_dem.sh --port-num 5236 --sysdba-pwd MyPassword --tomcat-port 8081 ``` ### Resume Installation (if interrupted) ```bash ./install_dem.sh # The script will automatically skip completed steps based on the finished steps in install_status.txt ``` ### Force Re-installation ```bash rm install_status.txt ./install_dem.sh ``` ## Configuration Before running the script, ensure the following environment variables are properly set in the script: - `DB_HOST`: Database server hostname or IP - `DB_PORT`: Database port (default: 5236) - `DB_USER`: Database username - `DB_PASS`: Database password - `DB_NAME`: Database name for DEM - `DEM_URL`: DEM service URL - `INSTALL_SERVICE_KEY`: Installation service key ## Important Notes ### File Naming Conventions - Use exact file patterns as specified above - The script uses fuzzy matching to find files - Ensure files are not corrupted and have correct permissions ### Directory Permissions - Ensure the installation user has write permissions to all directories - Tomcat and DM Agent directories require execute permissions ### Service Ports - Database default port: 5239 - Tomcat default port: 8080 - DM Agent service port: 6363 - DM Agent app port: 6364 - Ensure ports are not occupied by other services - Port checks are performed as Step 0 and can be skipped on subsequent runs ### Database Connectivity - The script will create and initialize the database instance automatically - DEM connects to metadata database using SYSDBA user by default ### Troubleshooting #### Common Issues 1. **File not found errors**: Verify file names and locations match the patterns above 2. **Permission denied**: Check directory and file permissions 3. **Database connection failures**: Verify database settings and network connectivity 4. **Service startup failures**: Check log files in respective service directories #### Log Files - Installation log: `$BASE_PATH/install_log_${LOG_TIMESTAMP}.log` - Tomcat logs: `$TOMCAT_HOME/logs/` - DM Agent logs: `$DMAGENT_HOME/logs/` ## Support For issues related to this installation script, check the script output and log files for detailed error information. Ensure all prerequisites are met before reporting issues.