Update the resources list so we get rid of all the entries in the server.xml
search cancel

Update the resources list so we get rid of all the entries in the server.xml

book

Article ID: 435076

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

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.

Environment

All supported releases of Watch4net|M&R

Cause

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.

Resolution

Follow these steps to create resource links in the database and then clean the XML configuration files.

Step 1: Create Resource Links

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"
  }
}'

 

Step 2: Comment Out XML Entries

Once the resources are successfully created, open the following files and comment out the corresponding <Resource> or <ResourceLink> entries:

  1. /APG/Web-Servers/Tomcat/Default/conf/server.xml
  2. All XML files present in /APG/Web-Servers/Tomcat/Default/conf/Catalina/localhost/ (e.g., APG.xml).

 

Step 3: Restart All the Services

./manage-modules.sh service restart all