LAMP Stack Pattern


[PDF]LAMP Stack Pattern - Rackcdn.comhttps://c368768.ssl.cf1.rackcdn.com/...

79 downloads 287 Views 553KB Size

LAMP Stack - VMware Sample Blueprint

Goal and Overview

The Microsoft SQL Server 2014 SP1 VMware sample blueprints is a working sample of provisioning a full Microsoft stack that includes IIS, .NET and Microsoft SQL Server on a single Windows 2012 R2 64 bit VM. This sample provides insight into the procedures, structure and some of the best practices of structuring such a blueprint, and is intended to be used as a learning tool or as a pattern to nest in application blueprints based on the LAMP stack. This blueprint consists of: a multi machine blueprint, an Apache load balancer in front of the Apache PHP components and a MYSQL database as the DB. The default settings in this example will download all the software components from open source repositories (using YUM), install and configure them. By changing the URLs to the repositories in the properties you can change the configuration to different open source repositories or a local repository (see property list below).

Prerequisites 1. You have a Linux RHEL / CentOS template to use for deploying the blueprint. This template should have both the guest agent and the software bootstrap agent pre installed and you have created a customization specification for cloning this template. 2. You have vRA 7.0 installed, configured and running a. You have created a vSphere endpoint b. You have added your vSphere compute resources to a fabric group. c. You have created a machine prefix d. You have configured a business group and assigned a default machine prefix to the group. e. You have created an external network profile to provide a gateway and a range of IP addresses. f. You have created a reservation for your vSphere endpoint and mapped your external network profile to your reservation. 3. You have downloaded and extracted the VMware CloudClient onto your machine

Predefined Input Properties The blueprint has the following properties defined. They are provided to make the blueprint more useful for real life situations and as an example for how to configure and use properties in blueprints. All required properties need to have a value for provisioning to be successful.

Apache Load Balancer Property

Description

Type

AJP_PROXY_CONTEXT

Optional property to set which URL context to proxy to Tomcat using ajp.

String

APPSRV_ROUTES

Application server route configuration to apply sticky sessions

AUTOGEN_STICKY_COO KIE

Set to YES when load balancing non-Java app servers

CONFIG_HTTPD_CONF

Read-only command string for other services to see how to stop apache.

["None"] Array

String

/etc/httpd/conf/httpd.conf

Read-only path to static site directory.

String

HTTP_NODE_IPS

Array of ips to proxy. Set to ["None"] to disable proxy.

Array

HTTP_PORT

Apache HTTP server port. When using Apache as a load balancer for an application server or a cluster of them, this port must bind to the relevant ports in those application server nodes.

NO

String

CONFIG_STATIC_SITE

HTTP_NODE_PORT

Default Value

/var/www/html

["None"]

["8080"] Array

HTTP port number to serve static content. Leave blank to disable this feature.

String

80

HTTP_PROXY_PORT

HTTP proxy port number

String

8081

HTTP_DIR

Read-only path to apache base dir String

/etc/httpd

String

/opt/vmware-jre

JAVA_HOME

The directory in which JRE 1.7 is installed

SERVICE_RESTART

Read-only command string for other services to see how to restart apache.

String

service httpd restart

SERVICE_START

Read-only command string for other services to see how to start apache.

String

service httpd start

SERVICE_STOP

Read-only command string for other services to see how to stop apache.

String

service httpd stop

TOMCAT_CONTEXT

Optional property of the WAR context to proxy to using ajp on Tomcat

String

USE_AJP

Enable this when configuring proxy to Tomcat instance that is using AJP. Set to YES or NO.

String

NO

Type

Default Value

Apache Server Property

Description

BASE_REPOSITORY_U RL_EPEL

Base Repository URL for 'epel' yum configuration

String

http://dl.fedoraproject.org/pub/epe l

BASE_REPOSITORY_U RL_REMI

Base Repository URL for 'remi' yum configuration

String

http://rpms.famillecol let.com/enterprise

BIND_IP

Host IP Address

String

HTTP_PORT

HTTP port

String

80

HTTP_PROXY_PORT

Proxy Port for HTTP

String

8081

phpMyAdmin

Property

Description

Type

Default Value

BIND_IP

IP Address of Database Host

String

DB_PORT

Database Port No. of MYSQL DB Host

String

3306

DOCUMENT_ROOT

Path for Apache Web Hosting Directory

String

/var/www/html

EPEL_DOWNLOAD_URL

url to download "Extra Packages for Enterprise Linux" yum repo configuration

Content

http://dl.fedoraproject.org/pub/e pel/7/x86_64/e/epel-release-75.noarch.rpm

MYSQL_DOWNLOAD_URL

url to download mysql yum repo configuration

Content

http://repo.mysql.com/mysqlcommunity-release-el75.noarch.rpm

PHP_CONFIG

Path for location of phpMyAdmin.conf

String

/etc/httpd/conf.d

PHP_INI_FILE

Path to php.ini file

String

/etc/php.ini

Type

Default Value

PHP Property

Description

MAX_EXECUTION_TIME

Maximum time in seconds a script is allowed to run before it is terminated by the parser

String

120

MEMORY_LIMIT

Maximum amount of memory in bytes that a script is allowed to allocate

String

128M

PHP_INI_FILENAME

Path to php.ini file

String

/etc/php.ini

POST_MAX_SIZE

Maximum size of post data allowed

String

50M

UPLOAD_MAX_FILESIZE

The maximum size of an uploaded file

String

50M

MySQL Property

Description

Type

Default Value

BIND_IP

Database Host IP Address

String

DB_PORT

Database Port

String

DB_ROOT_PASSWORD

Password of DB admin account. Note: "It should not be less than 5 Characters."

String

DB_ROOT_USERNAME

User name of DB admin account

String

root

MYSQL_DOWNLOAD_URL

Url to download mysql installation package

Content

http://repo.mysql.com/mysqlcommunity-release-el75.noarch.rpm

3306

Importing the LAMP Stack Pattern - VMware Sample into vRA Procedure

1. Go to your VMware CloudClient installation directory 2. Run CloudClient under the /bin directory. $>./bin/cloudclient.sh 3. If prompted, accept the license agreement. 4. Using VMware CloudClient, log in to the vRealize Automation Appliance as a user with software architect and infrastructure architect privileges. CloudClient>vra login userpass --user --tenant --server https:/// 5. When prompted, enter your login password. 6. Validate that the LAMPStackPattern.zip file content is available. vra content import --path // LAMPStackPattern.zip --dry-run true --resolution SKIP/OVERWRITE 7. Import the LAMP Stack Pattern - VMware Sample. vra content import --path // LAMPStackPattern.zip --resolution SKIP/OVERWRITE

When you log on to the vRealize Automation console as a software architect, you see the following components on the Design > Software Components tab: a. Machine 1 - Apache Load Balancer b. Machine 2 a. Apache Web Server b. PHP c. phpMyAdmin c. Machine 3 - MYSQL

Configure LAMP Stack Pattern - VMware Sample Components for Your Environment

As an infrastructure architect, you configure each of the LAMP Stack Pattern - VMware Sample machine components to use the customization specification, template, and machine prefixes that you created for your environment. This scenario configures the machine components to clone machines from the template you created in the vSphere Web Client.

Procedure

1. Log in to the vRealize Automation console as an infrastructure architect. 2. Select Design > Blueprints. 3. Select the LAMP Stack Pattern - VMware Sample blueprint and click the Edit icon. 4. Edit the CentOS-node so vRealize Automation can provision this machine component in your environment. a. Click the CentOS-node component on the design canvas. Configuration details appear in the bottom panel. b. Select your machine prefix from the Machine prefix drop-down menu. c. Click the Build Information tab. d. Select Cloneworkflow from the Provisioning workflow drop-down menu. e. Select your LAMP Stack Pattern - VMware Sample machine_template from the Clone from dialog. f. Enter the name of the Customization Spec from your vSphere configuration in the Customization spec text box This field is case sensitive. 5. Click Save and Finish. Your changes are saved and you return to the Blueprints tab. 6. Select the LAMP Stack Pattern - VMware Sample blueprint and click Publish. You configured the LAMP Stack Pattern - VMware Sample blueprint for your environment and published the finished blueprint but to be able to add it to the catalog you still need to configure a catalog service and add the blueprint to that service. Note: Time from request to provision may take up to 90 minutes depending on your network and VM performance.