getting started aws marketplace - amazon s3 · pdf filegetting started aws marketplace release...

18
Getting Started AWS Marketplace Release version Varnish Software Inc. March 1 st , 2017

Upload: duongdien

Post on 30-Mar-2018

238 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Getting Started AWS Marketplace

Release version

Varnish Software Inc.

March 1st, 2017

Page 2: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Table of Contents NOTE: 3 ......................................................................................................

VARNISH SOFTWARE INSTANCE DEPLOYMENT 4 ......................................................DEPLOY WITH 1-CLICK LAUNCH 4 ............................................................................DEPLOY WITH EC2 CONSOLE 6 ..............................................................................

VARNISH SOFTWARE CONFIGURATION 13 .............................................................CONNECTING TO YOUR VARNISH SOFTWARE INSTANCE 13 ....................................................GENERAL INFORMATION REGARDING VARNISH SOFTWARE CONFIGURATION 13 .................................

Varnish Plus - Administration (VAC) and Statistics (VCS) 13 ...................................Varnish Cache (VC) 13 ................................................................................Varnish Plus - Caching Engine (VCP) 14 ...........................................................

TESTING YOUR INSTANCE 15 .............................................................................VARNISH PLUS - ADMINISTRATION (VAC) AND STATISTICS (VCS) 16 .........................................VARNISH CACHE (VC) AND VARNISH PLUS - CACHING ENGINE (VCP) 17....................................

2

Page 3: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Note:

The difference between Varnish Plus – Administration (VAC) and Statistics (VCS), Varnish Cache (VC) and Varnish Plus – Caching Engine (VCP).

The Varnish Cache (VC) and the Varnish Plus – Caching Engine (VCP), catagorised as ”Reverse Proxy” or ”HTTP/web accelerator”, are standalone products. They can operate independently without any controller/monitoring node like Varnish Plus - Administration and Statistics. Customers have to supply their own version of Varnish Configuration Language (VCL) file to utilise a capability of Varnish Cache and Varnish Plus – Caching Engine thereafter.

The Varnish Plus - Administration (VAC) is a management console for groups of Varnish Cache/Varnish Plus – Caching Engine servers. It communicates to the caching servers through a small agent called ”varnish-agent”. Both Varnish Cache and Varnish Plus – Caching Engine AMIs have ”varnish-agent” pre-installed. It is required to be configured in order to see some outputs on Varnish Plus - Administration dashboard.

The Varnish Plus – Statistics (VCS) produces real-time aggregated statistics from a group of caching servers. The statistics produced are grouped according to keys defined in the Varnish Configuration Language (VCL) and presented in time series. Only Varnish Plus – Caching Engine AMIs have ”vstatdprobe” pre-installed. It is required to be configured in order to see some outputs on Varnish Plus - Statistics dashboard.

3

Page 4: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Varnish Software instance deployment Deploy with 1-click launch

Choose one of our products from Marketplace page from Varnish Software Inc., select your region on where to launch

Figure 1 - Varnish Software Product Page

Next you will be prompted to login to your AWS account.

4

Page 5: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

After login, you will be presented to select options for your Varnish Software instance, for example, EC2 instance type, Networking (VPC setting), Firewall setting (Security group), and Key pair. Once you select the appropriate setting, click on “Accept Software Terms & Launch with 1-Click” button and wait for the instance to start.

Figure 2 - 1-Click Launch Page

That’s it. You’re up and running with your Varnish Software instance. Next please tune up your configuration and start enjoying our products.

5

Page 6: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Deploy with EC2 console

There is another option to start the instance manually. Beside 1-Click launch tab window, select the tab “Manual Launch” and click on “Launch with EC2 console” button under “Region” section for a region you desire. You can check for pricing details on the right hand side of the page.

(For the first time user, you might need to click on the yellow “Accept Terms and Conditions” button before you are able to click on the “Launch with EC2 console” button.)

Figure 3 - Manual Launch Page

6

Page 7: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Once you clicked on “Launch with EC2 console” button, the Request Instance Wizard will be displayed. On the first screen (Step 2), you will be asked to choose an appropriate instance type. Select one and click Next.

Figure 4 - Step 2: Choose an Instance Type

7

Page 8: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

On this page (Step 3), you will be asked to configure for your instance details, such as Number of instance, Network information and Availability Zone. You would probably pass your “User data” script to run once the instance is up on this page as well. Once you done, click next.

Figure 5 - Step 3: Configure Instance Details

8

Page 9: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

On (Step 4) page, it is trivial for Varnish Plus – Administration and Statistics and Varnish Cache instances as they don’t require additional storage at all. However, it can be relevant for Varnish Plus – Caching Engine instance because Varnish Plus – Caching Engine provides Massive Storage Engine (MSE) out of box. It would be useful when you would like to have a persistent cache stored on your local SSD disk instead of in memory. Once you done, click next.

Figure 6 - Step 4: Add Storage

9

Page 10: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

You may skip (Step 5) because it is trivial. You may create any proper tags to the instance that you are about to launch as many as you like. It also can be configured any time on EC2 running instance page.

Figure 7 - Step 5: Tag (can be skipped)

10

Page 11: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

On (Step 6) page, you would be able to set Security Group which controls network access to your instance. If this is your first AMI, select “Create a new security group”, provide a name for the security group and fill in description for convenance then click on ”Add Rule”.

We recommended using the following security group policies for each Varnish Software instance. This is base on default configurations of the instances. You perhaps configure to be on different ports reflecting your setup later on. (For example, enabling TCP: 80 for caching nodes)

• Varnish Plus - Administration and Statisticso TCP: 22, 80, 443, 5558, 6085, 6555, 8088

• Varnish Cache o TCP: 22, 6081, 6085

• Varnish Plus - Caching Engine o TCP: 22, 443, 6081, 6085

Figure 8 - Step 6: Configure Security Group

11

Page 12: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

On the next screen, verify the settings and click on Launch to start the instance. When you press on Launch, you will see a dialog to create a new Key Pair. The key is used to connect to your Varnish Software instance. If this is your first AMI or wish to use a different key pair for this instance, select “Create a new Key Pair”, provide a name for it (we suggest “varnish-on-AWS”) and then click on “Download Key Pair“. You will be prompted to save the key on your computer then click on ”Launch instances”

Figure 9 Key Pair dialog

That’s it. You’re up and running with your Varnish Software instance. Next please tune up your configuration and start enjoying our products.

12

Page 13: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Varnish Software configuration Connecting to your Varnish Software instance

For Windows SSH client, you may use Putty. For Linux and Mac users, you may use your favourite SSH client.

For more information on how to access your Linux instance on AWS, please see;

• UserGuide - Connect your Linux instance from Windows with Putty • UserGuide - Connect your Linux instance with SSH

General information regarding Varnish Software configuration

The configuration files are located at on different places based on what kind of AMIs you are running, Varnish Plus - Administration and Statistics, Varnish Cache or Varnish Plus - Caching Engine.

In this section we cover the configuration basics. For more details and advanced configuration possibilities, please check the following links below here.

• Varnish Plus - Administration (VAC) - PDF • Varnish Plus - Statistics (VCS) - PDF • Varnish Cache (VC) - HTML • Varnish Plus - Caching Engine (VCP) - PDF

Varnish Plus - Administration (VAC) and Statistics (VCS) Varnish Plus - Administration and Statistics should be running out of box without any effort. Here are related configurations.

• MongoDB o /etc/mongodb.conf

• Varnish Plus - Administration o /opt/vac/etc/defaults o /opt/vac/etc/log4j.xml o /opt/vac/etc/roles.js o /opt/vac/etc/rrd_conf.xml

• Varnish Plus - Statistics o Ubuntu

▪ /etc/default/vstatd o RHEL

▪ /etc/varnish/vstatd.params

Varnish Cache (VC) By default, “varnishd” process should be running on TCP 6081. If you have a Varnish Plus – Administration and Statistics instance running on your environment, you may configure “varnish-agent” to talk to Varnish Plus - Administration to see some graphs and be able to deploy Varnish Cache Language (VCL) files to all registered Varnish Cache nodes by VAC Restful API.

13

Page 14: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

• Varnish o Ubuntu

▪ /etc/default/varnish o RHEL

▪ /etc/varnish/varnish.params • Varnish-agent

o Ubuntu ▪ /etc/default/varnish-agent

o RHEL ▪ /etc/varnish/varnish-agent.params

• Default VCL configuration o /etc/varnish/default.vcl

Varnish Plus - Caching Engine (VCP) Varnish Plus - Caching Engine is a supercharged version of Varnish Cache. Apart from ease of use improvement and performance enhancement from Varnish Cache, Varnish Plus - Caching Engine also provides more software functionalities like Varnish Massive Storage Engine (MSE), Varnish High Availability (VHA) and SSL/TLS support.

• Varnish Plus - Caching Engine o Ubuntu

▪ /etc/default/varnish o RHEL

▪ /etc/varnish/varnish.params • Varnish-agent

o Ubuntu ▪ /etc/default/varnish-agent

o RHEL ▪ /etc/varnish/varnish-agent.params

• Varnish Plus - Statistics probe o Ubuntu

▪ /etc/default/vstatdprobe o RHEL

▪ /etc/varnish/vstatdprobe.params • Varnish Plus HA

o Ubuntu ▪ /etc/default/vha-agent ▪ /etc/vha-agent/nodes.conf

o RHEL ▪ /etc/varnish/vha-agent.params ▪ /etc/vha-agent/nodes.conf

• Varnish Plus Addon SSL o Ubuntu

▪ /etc/default/hitch ▪ /etc/hitch/hitch.conf

o RHEL ▪ /etc/hitch/hitch.params ▪ /etc/hitch/hitch.conf

14

Page 15: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Testing your instance

Find out your network information concerning your running instances on AWS EC2 Running Instances page, AWS EC2 Dashboard -> Running Instances.

Figure 10 - AWS EC2 Dashboard

Select a node you want and you will see all information you need on ”Description” tab.

Figure 11 - Instance Description Page

15

Page 16: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Varnish Plus - Administration (VAC) and Statistics (VCS)

Point your browser to your AWS EC2 instance hostname/ip address (http://52.51.180.13 from an example above), you will be able to access to Varnish Plus - Administration login page. The default username is “vac” and the default password is an instance id of your running instance, which is “i-cc9bf340” from an example above.

Figure 12 - VAC login page

Once click “SIGN IN” button, you should be able to see a landing page like the following figure.

Figure 13 - VAC landing page

16

Page 17: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

To verify Varnish Plus - Statistics is running, point your browser to the same hostname/ip address but to the TCP port 6555 instead of a default HTTP 80 (http://52.51.180.13:6555 from an example above). You would be able to see a Varnish Plus - Statistics landing page without any authentication.

Figure 14 - VCS landing page

Varnish Cache (VC) and Varnish Plus - Caching Engine (VCP)

On Varnish Cachen and Varnish Plus - Caching Engine instances, there should be ”varnishd” process running on the process table out of box. You would simply verify the process status by running “curl” from your terminal to ”[hostname/ipaddress]:port”

terminal$ curl 52.208.187.80:6081 <!DOCTYPE html> <html> <head> <title>503 Backend fetch failed</title> </head> <body> <h1>Error 503 Backend fetch failed</h1> <p>Backend fetch failed</p> <h3>Guru Meditation:</h3> <p>XID: 6</p> <hr> <p>Varnish cache server</p> </body> </html>

terminal$ curl -I 52.208.187.80:6081 HTTP/1.1 503 Backend fetch failed Date: Thu, 17 Nov 2016 12:53:23 GMT

17

Page 18: Getting Started AWS Marketplace - Amazon S3 · PDF fileGetting Started AWS Marketplace Release version ... Statistics (VCS) ... o RHEL /etc/varnish/vstatd.params

Server: Varnish Content-Type: text/html; charset=utf-8 Retry-After: 5 X-Varnish: 32773 Age: 0 Via: 1.1 varnish-v4 Connection: keep-alive

If you see connection refuse error, that would mean the process is not running for some reason. You can simply fix it by running a restart command. Then try to curl check again.

terminal$ ssh 52.208.187.80 -lubuntu -i ~/.ssh/varnish-on-AWS "sudo service varnish restart" * Stopping HTTP accelerator varnish No /usr/sbin/varnishd found running; none killed. ...fail! * Starting HTTP accelerator varnish ...done.

*** Note that if the running instance is Ubuntu then the username is ”ubuntu”. If the running instance is Red Hat, then the username is ”ec2-user” ***

terminal$ ssh 52.208.187.80 -lubuntu -i ~/.ssh/varnish-on-AWS "netstat -nlt" Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 :::6081 :::* LISTEN

Now we are good to go. What you would like to do next is;

1. Configure a location of web server backend, you have to SSH to the instance and edit /etc/varnish/default.vcl, adding a backend and VCL caching rules you desire

terminal$ sudo vi /etc/varnish/default.vcl

2. Restart ”varnishd” service to active the current configuration

terminal$ sudo service varnish restart

3. You need to update your site’s DNS record to be a hostname/ip address of the running VC or VCP instances. After making the DNS change (allowing for DNS ttl expiry) you will start traffic coming to this instance.

For more advanced features and usage for VCP, please follow this documentation. • Varnish Plus - Caching Engine (VCP)

If it still does not work, please contact our support. We actually like to hear your problem, since that allows it to fix it for you and for future customers, so please do contact us.

18