You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/includes/linux/sql-linux-quickstart-connect-query.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,13 @@ The following steps use **sqlcmd** to locally connect to your new SQL Server ins
22
22
23
23
1. If successful, you should get to a **sqlcmd** command prompt: `1>`.
24
24
25
-
1. If you get a connection failure, first attempt to diagnose the problem from the error message. Then review the [connection troubleshooting recommendations](../linux/sql-server-linux-troubleshooting-guide.md#connection).
25
+
1. If you get a connection failure, first attempt to diagnose the problem from the error message. Then review the [connection troubleshooting recommendations](../../linux/sql-server-linux-troubleshooting-guide.md#connection).
26
26
27
27
## Create and query data
28
28
29
29
The following sections walk you through using **sqlcmd** to create a new database, add data, and run a simple query.
30
30
31
-
For more information about writing Transact-SQL statements and queries, see [Tutorial: Writing Transact-SQL Statements](../t-sql/tutorial-writing-transact-sql-statements.md).
31
+
For more information about writing Transact-SQL statements and queries, see [Tutorial: Writing Transact-SQL Statements](../../t-sql/tutorial-writing-transact-sql-statements.md).
32
32
33
33
### Create a new database
34
34
@@ -111,42 +111,42 @@ QUIT
111
111
112
112
## Performance best practices
113
113
114
-
After installing SQL Server on Linux, review the best practices for configuring Linux and SQL Server to improve performance for production scenarios. For more information, see [Performance best practices and configuration guidelines for SQL Server on Linux](../linux/sql-server-linux-performance-best-practices.md).
114
+
After installing SQL Server on Linux, review the best practices for configuring Linux and SQL Server to improve performance for production scenarios. For more information, see [Performance best practices and configuration guidelines for SQL Server on Linux](../../linux/sql-server-linux-performance-best-practices.md).
115
115
116
116
## Cross-platform data tools
117
117
118
118
In addition to **sqlcmd**, you can use the following cross-platform tools to manage SQL Server:
119
119
120
120
| Tool | Description |
121
121
| ---- | ----------- |
122
-
|[Azure Data Studio](../azure-data-studio/index.yml)| A cross-platform GUI database management utility. |
123
-
|[Visual Studio Code](../tools/visual-studio-code/sql-server-develop-use-vscode.md)| A cross-platform GUI code editor that run Transact-SQL statements with the mssql extension. |
124
-
|[PowerShell Core](../linux/sql-server-linux-manage-powershell-core.md)| A cross-platform automation and configuration tool based on cmdlets. |
122
+
|[Azure Data Studio](../../azure-data-studio/index.yml)| A cross-platform GUI database management utility. |
123
+
|[Visual Studio Code](../../tools/visual-studio-code/sql-server-develop-use-vscode.md)| A cross-platform GUI code editor that run Transact-SQL statements with the mssql extension. |
124
+
|[PowerShell Core](../../linux/sql-server-linux-manage-powershell-core.md)| A cross-platform automation and configuration tool based on cmdlets. |
125
125
|[mssql-cli](https://github.com/dbcli/mssql-cli/tree/master/doc)| A cross-platform command-line interface for running Transact-SQL commands. |
126
126
127
127
## Connecting from Windows
128
128
129
129
SQL Server tools on Windows connect to SQL Server instances on Linux in the same way they would connect to any remote SQL Server instance.
130
130
131
-
If you have a Windows machine that can connect to your Linux machine, try the same steps in this topic from a Windows command-prompt running **sqlcmd**. You must use the target Linux machine name or IP address rather than `localhost`, and make sure that TCP port 1433 is open on the SQL Server machine. If you have any problems connecting from Windows, see [connection troubleshooting recommendations](../linux/sql-server-linux-troubleshooting-guide.md#connection).
131
+
If you have a Windows machine that can connect to your Linux machine, try the same steps in this topic from a Windows command-prompt running **sqlcmd**. You must use the target Linux machine name or IP address rather than `localhost`, and make sure that TCP port 1433 is open on the SQL Server machine. If you have any problems connecting from Windows, see [connection troubleshooting recommendations](../../linux/sql-server-linux-troubleshooting-guide.md#connection).
132
132
133
133
For other tools that run on Windows but connect to SQL Server on Linux, see:
134
134
135
-
-[SQL Server Management Studio (SSMS)](../linux/sql-server-linux-manage-ssms.md)
@@ -78,7 +78,7 @@ ALTER EVENT SESSION AlwaysOn_health ON SERVER WITH (STARTUP_STATE=ON);
78
78
GO
79
79
```
80
80
81
-
For more information about this XE session, see [Configure extended events for Always On availability groups](../database-engine/availability-groups/windows/always-on-extended-events.md).
81
+
For more information about this XE session, see [Configure extended events for Always On availability groups](../../database-engine/availability-groups/windows/always-on-extended-events.md).
82
82
83
83
## Create a certificate
84
84
@@ -169,4 +169,4 @@ The TCP port on the firewall must be open for the listener port.
169
169
>
170
170
> For the SQL Server 2017 release, the only authentication method supported for the database mirroring endpoint is `CERTIFICATE`. The `WINDOWS` option will be enabled in a future release.
171
171
172
-
For more information, see [The database mirroring endpoint (SQL Server)](../database-engine/database-mirroring/the-database-mirroring-endpoint-sql-server.md).
172
+
For more information, see [The database mirroring endpoint (SQL Server)](../../database-engine/database-mirroring/the-database-mirroring-endpoint-sql-server.md).
Copy file name to clipboardExpand all lines: docs/includes/linux/ss-linux-cluster-pacemaker-concepts.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,16 @@
1
1
## <aname="pacemakerNotify"></a>Understand SQL Server resource agent for pacemaker
2
2
3
-
Before the CTP 1.4 release, the Pacemaker resource agent for availability groups could not know if a replica marked as `SYNCHRONOUS_COMMIT` was really up-to-date or not. It was possible that the replica had stopped synchronizing with the primary but was not aware. Thus the agent could promote an out-of-date replica to primary - which, if successful, would cause data loss.
4
-
5
-
SQL Server 2017 CTP 1.4 added `sequence_number` to `sys.availability_groups` to solve this issue. `sequence_number` is a monotonically increasing BIGINT that represents how up-to-date the local availability group replica is with respect to the rest of the replicas in the availability group. Performing failovers, adding or removing replicas, and other availability group operations update this number. The number is updated on the primary, then pushed to secondary replicas. Thus a secondary replica that is up-to-date will have the same sequence_number as the primary.
3
+
SQL Server 2017 introduced `sequence_number` to `sys.availability_groups` to show if a replica marked as `SYNCHRONOUS_COMMIT` was up to date. `sequence_number` is a monotonically increasing BIGINT that represents how up-to-date the local availability group replica is with respect to the rest of the replicas in the availability group. Performing failovers, adding or removing replicas, and other availability group operations update this number. The number is updated on the primary, then pushed to secondary replicas. Thus a secondary replica that is up-to-date will have the same sequence_number as the primary.
6
4
7
5
When Pacemaker decides to promote a replica to primary, it first sends a notification to all replicas to extract the sequence number and store it (we call this the pre-promote notification). Next, when Pacemaker actually tries to promote a replica to primary, the replica only promotes itself if its sequence number is the highest of all the sequence numbers from all replicas and rejects the promote operation otherwise. In this way only the replica with the highest sequence number can be promoted to primary, ensuring no data loss.
8
6
9
-
Note that this is only guaranteed to work as long as at least one replica available for promotion has the same sequence number as the previous primary. To ensure this, the default behavior is for the Pacemaker resource agent to automatically set `REQUIRED_COPIES_TO_COMMIT` such that at least one synchronous commit secondary replica is up to date and available to be the target of an automatic failover. With each monitoring action, the value of `REQUIRED_COPIES_TO_COMMIT` is computed (and updated if necessary) as ('number of synchronous commit replicas' / 2). Then, at failover time, the resource agent will require (`total number of replicas` - `required_copies_to_commit` replicas) to respond to the pre-promote notification to be able to promote one of them to primary. The replica with the highest `sequence_number` will be promoted to primary.
7
+
This is only guaranteed to work as long as at least one replica available for promotion has the same sequence number as the previous primary. To ensure this, the default behavior is for the Pacemaker resource agent to automatically set `REQUIRED_COPIES_TO_COMMIT` such that at least one synchronous commit secondary replica is up to date and available to be the target of an automatic failover. With each monitoring action, the value of `REQUIRED_COPIES_TO_COMMIT` is computed (and updated if necessary) as ('number of synchronous commit replicas' / 2). Then, at failover time, the resource agent will require (`total number of replicas` - `required_copies_to_commit` replicas) to respond to the pre-promote notification to be able to promote one of them to primary. The replica with the highest `sequence_number` will be promoted to primary.
10
8
11
9
For example, let's consider the case of an availability group with three synchronous replicas - one primary replica and two synchronous commit secondary replicas.
12
10
13
11
-`REQUIRED_COPIES_TO_COMMIT` is 3 / 2 = 1
14
12
15
-
- The required number of replicas to respond to pre-promote action is 3 - 1 = 2. So 2 replicas have to be up for the failover to be triggered. This means that, in the case of primary outage, if one of the secondary replicas is unresponsive and only one of the secondaries responds to the pre-promote action, the resource agent cannot guarantee that the secondary that responded has the highest sequence_number, and a failover is not triggered.
13
+
- The required number of replicas to respond to pre-promote action is 3 - 1 = 2. So 2 replicas have to be up for the failover to be triggered. This means that, in the case of primary outage, if one of the secondary replicas is unresponsive and only one of the secondaries responds to the pre-promote action, the resource agent can't guarantee that the secondary that responded has the highest sequence_number, and a failover isn't triggered.
16
14
17
15
A user can choose to override the default behavior, and configure the availability group resource to not set `REQUIRED_COPIES_TO_COMMIT` automatically as above.
> When you create the resource, and periodically afterwards, the Pacemaker resource agent automatically sets the value of `REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT` on the availability group based on the availability group's configuration. For example, if the availability group has three synchronous replicas, the agent will set `REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT` to `1`. For details and additional configuration options, see [High availability and data protection for availability group configurations](../linux/sql-server-linux-availability-group-ha.md).
1
+
> [!NOTE]
2
+
> When you create the resource, and periodically afterwards, the Pacemaker resource agent automatically sets the value of `REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT` on the availability group based on the availability group's configuration. For example, if the availability group has three synchronous replicas, the agent will set `REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT` to `1`. For details and additional configuration options, see [High availability and data protection for availability group configurations](../../linux/sql-server-linux-availability-group-ha.md).
0 commit comments