WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE
Contents 1. Pattern Overview... 3 1.1 Getting started with the MySQL Transactional Database Pattern... 4 1.2 Accepting licenses and configuring plug-ins... 4 1.3 Planning your database pattern... 4 2. Deploying MySql Transactional Database pattern... 5 2.1 Stand-alone MySQL Transactional Database Deployment Steps... 5 2.2 MySQL Transactional Database Deployment Steps with Replication policy... 6 2.3 Working with deployed database patterns... 7 2.4 Viewing virtual application instance logs... 8 WEBAPP PATTERN FOR APACHE TOMCAT 2
1. Pattern Overview MySql Transactional Database Pattern is a virtual application pattern that represents a pattern-deployed database service. The pattern manages MySql database deployment and life cycle. The pattern provides MySQL 5.5 as a transactional database. You can deploy the database pattern in one of the two ways described below 1. Standalone mode In this setup, database pattern deploys single MySQL instance Virtual instance MySql 5.5 2. Replication mode In this setup, database pattern deploys MySQL with Replication policy added to it. MySQL pattern deploys one master and one slave node. Replication is setup between Master and Slave node that provides redundancy and failover Virtual instance Virtual instance MySql 5.5 Master Replication MySql 5.5 Slave Replication mode failover handling When MySql database is setup in replication mode, the pattern handles failover scenarios as described below. Master node fails or Virtual instance with master instance goes down Slave node is promoted as new master Replacement node becomes slave and configured with new master Data is replicated to the new slave Slave node fails or Virtual instance with slave instance goes down Replacement node joins as new slave and configured with existing master. Data is replicated to the new slave WEBAPP PATTERN FOR APACHE TOMCAT 3
1.1 Getting started with the MySQL Transactional Database Pattern The MySQL Transactional Database Pattern is a standardized database pattern solution that can be reused to deploy and manage database instances in a cloud environment. The first step in using this pattern is to accept the license agreement. The process of accepting the license agreement is explained in next section. The next step is to create a virtual application template or use an existing virtual application template. The template is then used to build your database pattern. After you select a template and start building, the Virtual Application Builder opens where you can customize your database pattern with cloud component parts and policies. Virtual application patterns can be saved and cloned to build new customized patterns. Please see below, the version information associated with this pattern MySql Transactional Database Pattern version MySQL Version 1.0 5.5 1.2 Accepting licenses and configuring plug-ins You must complete license agreements and perform configuration tasks before you can use MySql Database Patterns. You must be logged in as an administrator to perform these tasks. To start using the MySQL Transactional Database Pattern you must accept the license agreement. To accept the license agreements follow these steps: 1. Click Cloud > Pattern Types. 2. In the list of pattern types, select MySQL Transactional Database Pattern 1.0 Type. The pattern details display on the right. 3. In the License Agreement field, click Accept. 4. After reading the license agreement, click Accept. The license agreement details changes to Accepted. 5. As an administrator, you should review and configure plug-ins before making the pattern type available for creating and deploying virtual applications. 6. Click Cloud > System Plug-ins. 7. Select MySQL Transactional Database Pattern, and then click Show me all Plug-ins in this pattern type in the Plug-ins field. 8. Review the plug-ins and their configuration options. Click Configure to view or update configuration settings. 9. Click Enable to change the pattern type status to Available. 1.3 Planning your database pattern Creating a database pattern consists of using the Virtual Application Builder to define and create the database pattern, and then deploying the pattern in the cloud environment. Gather the application artifacts and necessary information to configure the cloud components. For the database component type, a SQL script that can be deployed on a MySQL server is required. The script can contain DDL/DML statements that will be executed on the database that will be created by pattern WEBAPP PATTERN FOR APACHE TOMCAT 4
Gather the necessary information to configure the quality of service (QoS) policies. You can add a Replication policy if you want your data to be replicated After you collect the necessary information and artifacts previously described, you can begin using the Virtual Application Builder to design and configure the cloud components and policies to create your database pattern. 2. Deploying MySql Transactional Database pattern This section outlines the deployment steps for MySQL Transactional Database pattern in detail. 2.1 Stand-alone MySQL Transactional Database Deployment Steps 1. Go to Patterns -> Virtual Applications and select MySQL Transactional Database Pattern 1.0. 2. Click on the New button displayed in this page. 3. A pop-up window as Create Application will be displayed. Click on the button Start Building. 4. A new page as Virtual Application Builder will be displayed with MySQL displayed under the section Database Components 5. Drag this MySQL component on the middle pane. Following attributes will be displayed for this component: Name MySQL Database Name MySQL Schema File By default name of the component will be displayed as MySQL. You can edit it. Creates the database with the name provided. Default value is "MySQLDatabase".<Text> Script file with extension as.sql/.ddl uploaded by you is executed on database.<text> All the above attributes are mandatory. 6. Upload a valid.sql /.ddl file and save the pattern by giving its name and description 7. Close the Virtual Application Builder page. Now go to Patterns -> Virtual Applications page. 8. Select the pattern saved in above step and click the Deploy button. 9. Go to Instances->Virtual Applications and check deployment status for the pattern. 10. After sometime (approximately 30 minutes), the pattern will be deployed and will be displayed in Running mode. 11. Click on the End-point link. The details displayed here are as below: Endpoint Port IP address of the virtual machine on which MySQL database has been installed Database port number Database user Database user name Database Password Database password WEBAPP PATTERN FOR APACHE TOMCAT 5
2.2 MySQL Transactional Database Deployment Steps with Replication policy 1. Go to Patterns -> Virtual Applications and select MySQL Transactional Database Pattern 1.0 2. Click on the New button displayed in this page. 3. A pop-up window as Create Application will be displayed. Click on the button Start Building. 4. A new page as Virtual Application Builder will be displayed with MySQL displayed under the section Database Components 5. Drag this MySQL component on the middle pane. Following attributes will be displayed for this component : Name MySQL Database Name MySQL Schema File By default name of the component will be displayed as MySQL. You can edit it. Creates the database with the name provided. Default value is "MySQLDatabase". Script file with extension as.sql/.ddl uploaded by you is executed on database. All the above attributes are mandatory. 6. Click on the + symbol present inside the component and add the Replication Policy. 7. Upload a valid.sql/.ddl file and save the pattern by giving name and description. 8. Close the Virtual Application Builder page. Now go to Patterns -> Virtual Applications page. 9. Select the pattern saved in above step and click the Deploy button. 10. Go to Instances->Virtual Applications and check deployment status for the pattern. 11. After sometime (approximately 30 minutes), the pattern will be deployed and will be displayed in Running mode 12. Click on the End-point link. The details displayed here are as below: Endpoint Port IP address of the virtual machine on which MySQL database has been installed Database port number Database user Database user name Database Password Database password Note: In this scenario, you can connect to only Master node using the above credentials. The slave cannot be directly connected. WEBAPP PATTERN FOR APACHE TOMCAT 6
2.3 Working with deployed database patterns Deleting database patterns You can delete the database patterns that are used to provision databases using MySql Transactional Database Pattern. Procedure 1. Click Patterns > Virtual Applications. Select MySql Transactional Database Pattern 1.0 from the dropdown list 2. In the list, click the name of the database pattern you want to delete. 3. Click the Delete icon. 4. Click Yes in the dialog box. Deleting a pattern does not affect any databases previously deployed from that pattern. After you have deployed a database pattern, you can monitor and administer the deployed pattern directly from the Virtual Application Console. Monitoring the MySQL Transactional Database Pattern components Your pattern must be deployed and all of your virtual machines started before you can monitor results. Use the user interface to monitor the following statistics for your deployed virtual machines. Memory Network Process Storage To monitor these statistics follow these steps: 1. Click Instances > Virtual Application Instances. The Virtual Application Instances pane displays. 2. Select a virtual application instance. The virtual application instance details display to the right. 3. Click Manage on the toolbar. 4. Click Monitoring->Virtual Machine->The graphs for above four entities are displayed to the right. Managing the MySQL Transactional Database Pattern via Operations Once the database pattern is deployed, you can provide additional database changes through Operations page. For this below steps need to be followed: 1. Go to Instances ->Virtual Applications page and select the instance which has been deployed successfully and click on the Manage button for it. 2. A new page will open up showing Monitoring as the default tab. Go to Operations tab and select the MySQLMaster option. 3. Click on the Edit button and upload a.sql file containing the changes to be done in the database configuration (create, insert, update or delete statements). 4. After it gets uploaded, click on Submit button 5. Once the updates are completed, a success message will be displayed under the section Operation Execution Results. This message confirms that updates have been done in the database configuration. Note: If you have setup MySql with replication policy, the uploaded SQL operations (DDL/DML) will be executed on master. The changes in master will then be replicated to slave through replication policy WEBAPP PATTERN FOR APACHE TOMCAT 7
2.4 Viewing virtual application instance logs Your database patterns must be deployed and all of your virtual machines started before you can monitor results. 1. Click Instances > Virtual Application Instances. The Virtual Application Instances pane displays with the virtual application instances listed. 2. Select a virtual application instance. The details display to the right. 3. Click Log, located under the VM Status column to view the virtual machine status logs. The Log Viewer pane displays with organized log sections, such as operating system log, pattern type plug-in log and agent log. 4. The following types of logs can be viewed in the Log Viewer: MySQL logs: mysql_artifacts_log.log mysql_master_log.log mysql_mysqllog.log Shows the errors, if any, present in the schema file uploaded for the database. Provides master's initial log position and log level details as required by slave for replication purpose. Logs created during installation of MySQL mysql_user.log Shows database password with which database can be connected 5. You can also view the log files in the Virtual Application Console. After you select the virtual application instance and the details display to the right, you can click Manage on the toolbar. Select the virtual machine for which you want to view logs. Click Logging on the dashboard. 6. Expand each section to view the logs. 7. Optional: Download the log file. After you expand the log type and select a log, you can click the green arrow to download the log. Persistent Systems (BSE & NSE: PERSISTENT) builds software that drives our customers business; enterprises and software product companies with software at the core of their digital transformation. For more information, please visit http:// India Persistent Systems Limited Bhageerath, 402, Senapati Bapat Road Pune 411016. Tel: +91 (20) 6703 0000 Fax: +91 (20) 6703 0009 USA Persistent Systems, Inc. 2055 Laurelwood Road, Suite 210 Santa Clara, CA 95054 Tel: +1 (408) 216 7010 Fax: +1 (408) 451 9177 Email: info@persistent.com WEBAPP PATTERN FOR APACHE TOMCAT 8