Vous êtes sur la page 1sur 12

Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 1 of 12

Lab Answer Key: Module 11: AlwaysOn Availability


Groups

Lab: Implementing an Always On Availability Group

Exercise 1: Implementing an AlwaysOn Availability Group

Task 1: Prepare the Lab Environment

1. Start only the 20465C-MIA-DC, 20465C-MIA-AG-CLUST1, 20465C-MIA-AG-


CLUST2, and 20465C- MIA-AG-CLUST3 virtual machines. Then log on to 20465C-
MIA-AG-CLUST1as ADVENTUREWORKS\Student with the password Pa$$w0rd.

2. In the D:\Labfiles\Lab11\Starter folder, right-click Setup.cmd, and then click Run as


administrator.

3. In the User Account Control dialog box, click Yes, and wait for the script to finish.

Task 2: Perform Pre-Installation Checks

1. On the Start screen, type Failover. Then start the Failover Cluster Manager app.

2. In Failover Cluster Manager, in the left pane, expand MIA-


CLUSTER.adventureworks.msft, and then click Nodes. Verify that the following
cluster nodes are listed with a status value of Up:

o MIA-CLUST1

o MIA-CLUST2

o MIA-CLUST3

3. Close Failover Cluster Manager.

4.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 2 of 12

On the Start screen, type SQL Server. Then start the SQL Server 2014 Configuration
Manager app.

5. In the User Account Control dialog box, click Yes.

6. In the left pane, click SQL Server Services, in the right pane, double-click SQL Server
(MSSQLSERVER).

7. In the SQL Server (MSSQLSERVER) Properties dialog box, on the AlwaysOn High
Availability tab, verify that AlwaysOn Availability Groups are enabled for the MIA-
CLUSTER failover cluster, and then click Cancel. This setting has been applied to all
the servers in the cluster.

8. Close SQL Server Configuration Manager.

Task 3: Backup Databases

1. Start SQL Server Management Studio and connect to the MIA-CLUST1 database
engine instance using Windows authentication.

2. In Object Explorer, expand Databases, right-click the HumanResources database, point


to Tasks, and then click Back Up.

3. In the Back Up Database HumanResources dialog box, in the Destination list, click
the existing backup file path, click Remove, and then click Add.

4. In the Select Backup Destination dialog box, in the File name box, type
D:\Labfiles\Lab11\Starter\DataShare\HumanResources.bak, and then click OK.

5. In the Back Up Database HumanResources dialog box, in the Backup type list,
ensure that Full is selected, and then click OK.

6. In the Microsoft SQL Server Management Studio dialog box, click OK.

7. Repeat steps 3 to 7 to perform a full database backup of the ResellerSales database,


using the backup path D:\Labfiles\Lab11\Starter \DataShare\ResellerSales.bak.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 3 of 12

Task 4: Create an Availability Group

1. In SQL Server Management Studio, in Object Explorer, expand AlwaysOn High


Availability, right-click Availability Groups, and then click New Availability Group
Wizard.

2. In the New Availability Group wizard, on the Introduction page, click Next.

3. On the Specify Availability Group Name page, in the Availability group name box,
type MIA- SQL-AG, and then click Next.

4. On the Select Databases page, select the HumanResources and ResellerSales database
check boxes, and then click Next.

5. On the Specify Replicas page, on the Replicas tab, click Add Replica.

6. In the Connect to Server dialog box, in the Server name box, type MIA-CLUST2, in
the Authentication list, ensure Windows Authentication is selected, and then click
Connect.

7. Repeat steps 5 and 6 to add MIA-CLUST3 as a replica.

8. On the Replicas tab, select the Automatic Failover check box for MIA-CLUST1 and
MIA-CLUST2. This automatically selects the Synchronous Commit check box for
these replicas.

9. On the Replicas tab, in the Readable Secondary list for MIA-CLUST2, click Read-
intent only.

10. On the Replicas tab, in the Readable Secondary list for MIA-CLUST3, click Yes.

11. Review the default settings on the Endpoints and Backup Preferences tabs, and then
click the Listener tab.

12. Click Create an availability group listener, and then specify the following settings:

o Listener DNS Name: MIA-SQL-CLUST

o Port: 1433

o Network Mode: Static IP

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 4 of 12

13. Click Add, and in the Add IP Address dialog box, in the IPv4 Address box, type
10.10.0.40, and then click OK.

Note: If Add is not visible, you may need to maximize the dialog box or increase
the screen resolution of the virtual machine).

14. On the Specify Replicas page, click Next.

15. On the Select Initial Data Synchronization page, ensure that Full is selected.

16. In the Specify a shared network location accessible by all replicas box, type \\MIA-
CLUST1\DataShare, and then click Next.

17. On the Validation page, review the validation results, and then click Next.

18. On the Summary page, click Finish.

19. On the Results page, you may see a warning about the cluster quorum. This will not
affect the lab. If you do see this warning, review it, and then click Close.

Task 5: Check the Status of the AlwaysOn Availability Group

1. In Object Explorer, expand Availability Groups, expand MIA-SQL-AG (Primary) and


all its subfolders.

2. Right-click MIA-SQL-AG (Primary), and then click Show Dashboard.

3. Wait for the dashboard to connect to the availability group, and then review the status
information. In the Availability replica table, note that the replicas MIA-CLUST1 and
MIA-CLUST2 should show as Synchronized and MIA-CLUST3 should show as
Synchronizing.

4. Minimize SQL Server Management Studio. You will use it again in a later exercise.

Results: After completing this exercise, you will have:


Performed pre-installation checks for an AlwaysOn Availability Group.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 5 of 12

Backed up the availability databases.


Created an AlwaysOn Availability Group.
Checked the status of the AlwaysOn Availability Group.

Exercise 2: Connecting to an AlwaysOn Availability Group

Task 1: Connect to the Primary Replica

1. In the lower-left corner of the task bar, click Start, type cmd, and then click Command
Prompt.

2. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-SQL-CLUST availability group listener, and then press Enter:

sqlcmd -E -S MIA-SQL-CLUST

3. At the command prompt, type the following commands to verify that the SQLCMD
session is connected to the primary replica (MIA-CLUST1):

SELECT @@ServerName
GO

4. At the command prompt, type the following commands to retrieve rows from the
Employee table in the HumanResources database, and then view the results:

SELECT * FROM HumanResources.dbo.Employee


GO

5. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:

Exit

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 6 of 12

6. Keep the command prompt open for the next task.

Task 2: Connect to a Secondary Replica

1. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-CLUST3 replica, and then press Enter:

sqlcmd -E -S MIA-CLUST3

2. At the command prompt, type the following commands to retrieve rows from the
Employee table in the HumanResources database, and then view the results:

SELECT * FROM HumanResources.dbo.Employee


GO

3. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:

Exit

4. Keep the command prompt open for the next task.

Task 3: Connect by Using a Read-Intent Connection

1. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-CLUST2 replica, and then press Enter:

sqlcmd -E -S MIA-CLUST2

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 7 of 12

2. At the command prompt, type the following commands to attempt to retrieve rows from
the Employee table in the HumanResources database:

SELECT * FROM HumanResources.dbo.Employee


GO

3. View the error that is returned.

4. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:

Exit

5. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-CLUST2 replica with a read-intent connection, and then press Enter:

sqlcmd -E -S MIA-CLUST2 -K ReadOnly

6. At the command prompt, type the following commands to attempt to retrieve rows from
the Employee table in the HumanResources database, and then view the results:

SELECT * FROM HumanResources.dbo.Employee


GO

7. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:

Exit

8. Minimize the command prompt window. You will use it again in the next exercise.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 8 of 12

Results: After completing this exercise, you will have:


Tested connectivity to the primary replica.
Tested connectivity to a secondary replica.
Tested connectivity by using a read-intent connection.

Exercise 3: Testing Failover

Task 1: Initiate Manual Failover

1. Maximize SQL Server Management Studio and view the dashboard for the MIA-SQL-
AG availability group.

2. At the upper-right of the dashboard, click Start Failover Wizard.

3. In the Fail Over Availability Group: MIA-SQL-AG wizard, on the Introduction


page, click Next.

4. On the Select New Primary Replica page, select the MIA-CLUST2 check box, and
then click Next.

5. On the Connect to Replica page, click Connect.

6. In the Connect to Server dialog box, click Connect.

7. On the Connect to Replica page, click Next.

8. On the Summary page, click Finish.

9. On the Results page, click Close.

10. In the dashboard, note that the primary instance is now MIA-CLUST2 and that MIA-
CLUST1 is a secondary replica.

11. Minimize SQL Server Management Studio.

12. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-SQL-CLUST availability group listener, and then press Enter:

sqlcmd -E -S MIA-SQL-CLUST

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 9 of 12

13. At the command prompt, type the following commands to verify that the SQLCMD
session is connected to the new primary replica (MIA-CLUST2):

SELECT @@ServerName
GO

14. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:

Exit

15. Keep the command prompt open for the next task.

Task 2: Initiate Automatic Failover

1. On the taskbar, click SQL Server Management Studio, and then in Object Explorer,
click Connect Object Explorer.

2. In the Connect to Server dialog box, in the Server name box, type MIA-CLUST2, in
the Authentication list, ensure Windows Authentication is selected, and then click
Connect.

3. In Object Explorer, right-click MIA-CLUST2, and then click Stop.

4. In the Use Account Control dialog box, click Yes, and then in the Microsoft SQL
Server Management Studio dialog box, click Yes.

5. If a second Microsoft SQL Server Management Studio dialog box appears, click Yes.

6. In the MIA-SQL-AG dashboard, note the warnings for MIA-CLUST2.

7. Minimize SQL Server Management Studio.

8. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-SQL-CLUST availability group listener, and then press Enter:

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 10 of 12

sqlcmd -E -S MIA-SQL-CLUST

9. At the command prompt, type the following commands to verify that automatic failover
has resulted in MIA-CLUST1 resuming the primary replica role:

SELECT @@ServerName
GO

10. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:

Exit

11. Close the command prompt, but leave SQL Server Management Studio open.

Results: After completing this exercise, you will have:


Tested manual failover.
Tested automatic failover.

Exercise 4: Remove the Quorum Vote from the Reporting Server

Task 1: View the Current Quorum Configuration

1. In SQL Server Management Studio, in Object Explorer, right-click MIA-CLUST2, and


then click Start.

2. In the Use Account Control dialog box, click Yes.

3. In the MIA-SQL-AG Availability Group dashboard, click View Cluster Quorum


Information.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 11 of 12

4. In the Cluster Quorum Information dialog box, review the information, and note that
each of the three nodes in the cluster has one vote.

5. In the Cluster Quorum Information dialog box, click Close.

Task 2: Change the Quorum Configuration

1. Start Failover Cluster Manager.

2. Click MIA-CLUSTER.Adventureworks.msft, in the Actions pane, click More


Actions, and then click Configure Cluster Quorum Settings.

3. In the Configure Cluster Quorum Wizard dialog box, click Next.

4. On the Select Quorum Configuration Option page, click the Advanced quorum
configuration and witness selection radio button, and then click Next.

5. On the Select Voting Configuration page, click Select Nodes, clear the MIA-CLUST3
check box, and then click Next.

6. On the Configure Quorum Management page, click Next.

7. On the Select Quorum Witness page, click the Configure a file share witness radio
button, and then click Next.

8. On the Configure File Share Witness page, in the File Share Path field, type \\MIA-
DC\WitnessShare, and then click Next.

9. On the Confirmation page, click Next, wait for the configuration to complete, and then
click Finish.

10. In SQL Server Management Studio, on the MIA-SQL-AG dashboard, click View
Cluster Quorum Configuration Information.

11. In the Cluster Quorum Information dialog box, review the information, noting that
MIA-CLUST3 does not have a vote and that the file share witness has one vote. Click
Close.

12. Close SQL Server Management Studio, and then close Failover Cluster Manager.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 12 of 12

13. In the D:\Labfiles\Lab11\Starter, folder right-click Cleanup.cmd, click Run as


administrator, in the User Account Control dialog box, click Yes.

Results: After completing this exercise, you will have:


Viewed the quorum configuration by using Failover Cluster Manager and SQL Server
Management Studio.
Removed the quorum vote from the MIA-CLUST3 node and configured a file share
witness.

https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016

Vous aimerez peut-être aussi