Administrators need to remove manual database (JDBC) and management (WebService) resource entries from the server.xml file to move them into the managed resource database. This is common when streamlining configurations.
All supported releases of Watch4net|M&R
Resource entries are manually configured in XML files, which can make management difficult and leads to bloated configuration files. Migrating these to the resource table allows for easier centralized management.
Follow these steps to create resource links in the database and then clean the XML configuration files.
Use the manage-resources.sh script to create the resources in the database using the JSON payloads derived from your current XML entries.
Example: Create APG DB Resource
./manage-resources.sh create dba/APG-DB '{ "type": "jdbc", "datasource": { "maxActive": "10", "maxIdle": "10", "validationQuery": "SELECT 1", "testOnBorrow": "false", "testWhileIdle": "true", "validationQueryTimeout": "5", "timeBetweenEvictionRunsMillis": "10000", "minEvictableIdleTimeMillis": "60000", "maxWait": "10000", "removeAbandoned": "true", "removeAbandonedTimeout": "60", "logAbandoned": "true", "driverClassName": "com.mysql.jdbc.Driver", "username": "apg", "password": "[ENCRYPTED_PASSWORD]", "url": "jdbc:mysql://[IP_ADDRESS]:53306/apg?autoReconnect=true&connectTimeout=20000&maxReconnects=2&useSSL=false" }, "settings": {"cachegrp": "DB"}}'
Example: Create Management Resource
./manage-resources.sh create mgmt/APG-DB '{ "type": "webservice", "connection": { "disableSSLValidation": true, "url": "https://[IP_ADDRESS]:48443/Backends/APG-Backend/Default", "user": "admin", "password": "[ENCRYPTED_PASSWORD]" } }'
Example: Create Events MySQL Resource
./manage-resources.sh create dba/FLOW-RPE2-LIVE '{ "type": "jdbc", "datasource": { "maxActive": "10", "maxIdle": "10", "validationQuery": "SELECT 1", "testOnBorrow": "false", "testWhileIdle": "true", "validationQueryTimeout": "5", "timeBetweenEvictionRunsMillis": "10000", "minEvictableIdleTimeMillis": "60000", "maxWait": "10000", "removeAbandoned": "true", "removeAbandonedTimeout": "60", "logAbandoned": "true", "driverClassName": "com.mysql.jdbc.Driver", "username": "apg", "password": "[ENCRYPTED_PASSWORD]", "url": "jdbc:mysql://[IP_ADDRESS]:53306/events?autoReconnect=true&tinyInt1isBit=false&connectTimeout=20000&maxReconnects=2&useSSL=false" }, "disabled": false, "settings": { "mapping": "FLOW-RPE2.xml", "table": "events_live" }}'
Once the resources are successfully created, open the following files and comment out the corresponding <Resource> or <ResourceLink> entries:
/APG/Web-Servers/Tomcat/Default/conf/server.xml/APG/Web-Servers/Tomcat/Default/conf/Catalina/localhost/ (e.g., APG.xml)../manage-modules.sh service restart all