SQL Server AlwaysOn Build five: AlwaysOn configuration

Source: Internet
Author: User
Tags failover

  • Enable AlwaysOn
    In SQL Server Configuration Manager on the SQL01 and SQL02 servers, right-click the SQL Server service select Properties

    In the AlwaysOn High Availability tab, you can see that Windows Failover Cluster name is the Sqlalwayson cluster created previously, tick enable AlwaysOn availability Groups

    Restart SQL Server Services
    2. Create a test database
    CREATE DATABASE [always_test_1]
    Containment = NONE
    On PRIMARY
    (NAME = n ' always_test_1 ', FILENAME = N ' C:\sql01\Always_test_1.mdf ', SIZE = 3072KB, MAXSIZE = UNLIMITED, filegrowth = 10 24KB)
    LOG on
    (NAME = n ' always_test_1_log ', FILENAME = N ' C:\sql01\Always_test_1_log.ldf ', SIZE = 1024KB, MAXSIZE = 2048GB, filegrowt H = 10%)
    GO
  • Configure AlwaysOn High Availability

    Click New Availability Group Wizard ...


    Availability Group Name:sql_ag

    Here the database check compliance is configured with the AG condition
    BACKUP DATABASE always_test_1 to disk= ' C:\sql01\Always_test_1_full.bak '
    When you are done, click Refresh

    Tick Click Next

    Click Add Replica ... Connection sql02,sql01/sql02 tick options and configuration as above, endpoints default (if multiple NICs, need to be configured for specific IP)

    Select Full Auto-sync data (select Join only needs to restore SQL01 in sql02 and log backups, and the Restore option is NORECOVERY), configure the Quorum folder as the transfer path

    Validation fails, you need to create a directory of C:\SQL01 recovery data above sql02, and click Re-run after creation Validation




    After the connection Sql01,sql02,alwayson configuration is successful, the following
  • Create Availability Group Listener

    Listener DNS Name:sqllistener
    port:1433
    Network mode:static IP
    IP address:192.168.0.111
    Use the Sqllistener connection as follows
  • Inspection configuration
    After the configuration is complete, the DC AD computers is as follows

    DNS is as follows

    Failover Cluster Manager is as follows

  • Fail-over Test
    Simulation of downtime, sql01 shutdown, SQL01 display as down state (there is a downward arrow), primary automatically transferred to SQL02, as follows

    Sql01 re-boot, secondary recovery, as follows

    After sql02 shutdown, the primary automatically transfers to SQL01, as follows
  • SQL Server AlwaysOn Build five: AlwaysOn configuration

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.