现在的位置: 首页 > 综合 > 正文

亚马逊EC2负载均衡的建立

2013年08月10日 ⁄ 综合 ⁄ 共 3183字 ⁄ 字号 评论关闭
  1. To define a load balancer

     

    1. Start the Create Load Balancer wizard:

    1. From the AWS Management Console,
      select Amazon EC2 from the drop-down list box, then
      click Sign in to the AWS Console, and log in with the email
      address and password you used when signing up for Amazon EC2.

      Console home
      [Tip] Tip

      If you pause for a long period of time during this procedure, the AWS
      Management Console automatically logs you out. To stay logged in while you work
      through this tutorial, click Settings in the top right corner
      of the console window and clear the Sign out on inactivity
      check box.

    2. Click Load Balancers in the Navigation pane.

      The console displays the Load Balancers pane.

    3. From the Load Balancers pane, click Create Load Balancers.

      The DEFINE LOAD BALANCER page of the
      Create a New Load Balancer wizard opens.

     

    Define Load Balancer Page
    这块可以设置自定义的服务器来负责负载均衡,其余的是亚马逊提供的服务器。
    如可以建立一个nginx 服务器,然后让指向多个示例的端口,nginx服务器的端口设置为80,
    就可以在以上选择自定义。

     

  2. On the DEFINE LOAD BALANCER page, enter a name
    for your load balancer (e.g., myLB).

     

    Name your load balancer

     

  3. Leave the Listener Configuration set to the default value for this example.

    [Important] Important

    The default settings require that your Amazon EC2 HTTP servers are active and accepting requests on port 80.

  4. Click Continue.

    The CONFIGURE HEALTH CHECK page of the Create a New Load Balancer wizard opens.

     

    To configure the health check

    1. On the CONFIGURE HEALTH CHECK page of the Create a New Load Balancer wizard, set the Configuration Options for your load balancer.

       

      Configure Health Check Page

       

      1. Leave Ping Protocol set to its default value of HTTP.

      2. Leave Ping Port set to its default value of 80.

        Elastic Load Balancing uses the Ping Port to send health check queries to your Amazon EC2 instances.

        [Important] Important

        Your Amazon EC2 instances must accept incoming traffic on this port. This guide assumes that each of
        your instances has a working HTTP server that accepts incoming traffic on port 80.

      3. In the Ping Path field, replace the default value with a single forward slash ("/").

         

        Configure Ping Path

         

        Elastic Load Balancing sends health check queries to the path you specify in Ping Path.
        This example uses a single forward slash so that Elastic Load Balancing sends the query to your HTTP server's default
        home page, whether that default page is named index.html, default.html, or
        a different name.

    2. Leave the Advanced Options set to their default values.

    3. Click Continue.

      The ADD INSTANCES page of the Create a New Load Balancer wizard opens.

       

      To add Amazon EC2 instances

      1. On the ADD EC2 INSTANCES page of the
        Create a New Load Balancer wizard,
        select the check box next to each instance you want to add.

         

        Add Instances Page

         

        [Important] Important

        This guide assumes that you have already created two
        or more Amazon EC2 instances with active HTTP servers.

      2. Click Continue.

        The REVIEW page of the Create a New Load Balancer wizard opens.

      3. Review your settings. You can make changes to the settings by clicking the edit link
        for a specific step in the process.

         

        ELB Wizard Review Page

         

        [Important] Important

        After you create a load balancer, you can modify any of the settings, except for
        Load Balancer Name and Port Configuration.
        To rename a load balancer or change its port configuration, create a replacement load balancer.

      4. Click Create.

        A confirmation window opens.

         

        ELB Wizard Review Page

         

      5. Click Close.

        The confirmation window closes, returning you to the Load Balancers page.
        Your new load balancer now appears in the list.

         

        ELB Page list of load balancers

         

      6. Select the check box next to your load balancer.

        A set of tabs opens with details about your new load balancer.

         

        ELB details page

         

      To test your load balancer, copy the DNS Name value that is listed in the Description
      tab and paste it into the address field of an Internet-connected web
      browser. If your load balancer is working, you will see the default page
      of your HTTP server.

      Normally you'd continue using the load balancer. However, for the
      purposes of this tutorial, we're going to show you how to terminate the
      load balancer immediately.
      Click Delete Load Balancer to continue.

抱歉!评论已关闭.