Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 5ed6b3a

Browse files
authored
Merge pull request #14787 from MikeRayMSFT/20200430-Enable-External-Scripts
Stage update to enable replica.
2 parents 7706977 + 45fccb4 commit 5ed6b3a

2 files changed

Lines changed: 82 additions & 23 deletions

File tree

docs/big-data-cluster/machine-learning-services.md

Lines changed: 82 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: SQL Server Big Data Clusters
44
description: Learn how you can run Python and R scripts on the master instance of a SQL Server Big Data Clusters with Machine Learning Services.
55
author: dphansen
66
ms.author: davidph
7-
ms.date: 11/04/2019
7+
ms.date: 04/30/2020
88
ms.topic: conceptual
99
ms.prod: sql
1010
ms.technology: machine-learning
@@ -31,39 +31,68 @@ RECONFIGURE WITH OVERRIDE
3131
GO
3232
```
3333

34-
## Enable Always On Availability Groups
34+
You are now ready to run Python and R scripts on the master instance of Big Data Clusters. See the quickstarts under [Next steps](#next-steps) to run your first script.
3535

36-
If you are using SQL Server Big Data Clusters with [Always On Availability Groups](../database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.md), you need to perform a few extra steps to enable Machine Learning Services.
36+
>[!NOTE]
37+
>The configuration setting cannot be set on an availability group listener connection. If Big Data Clusters is deployed with high availability, the set `external scripts enabled` on each replica. See [Enable on cluster with high availability](#enable-on-cluster-with-high-availability).
3738
38-
1. Connect to the master instance and run this statement:
39+
## Enable on cluster with high availability
3940

40-
```sql
41-
SELECT @@SERVERNAME
42-
```
41+
When you [Deploy SQL Server Big Data Cluster with high availability](deployment-high-availability.md), the deployment creates an availability group for the master instance. To enable Machine Learning Services, set `external scripts enabled` on each instance of the availability group. For a Big Data Cluster, you need to run `sp_configure` on each replica of the SQL Server master instance
4342

44-
Note down the server name. In this example, the server name for the master instance is **master-2**.
43+
The following section describes how to enable external scripts on each instance.
4544

46-
1. On each replica on the Always On Availability Group in the Big Data Cluster, run these `kubectl` commands:
45+
### Create an external load balancer for each instance
4746

48-
```
49-
kubectl -n bdc expose pod master-0 --port=1533 --name=mymaster-0 --type=LoadBalancer
47+
For each replica on the availability group, create a load balancer to allow you to connect to the instance.
5048

51-
kubectl -n bdc expose pod master-1 --port=1533 --name=mymaster-1 --type=LoadBalancer
49+
`kubectl expose pod <pod-name> --port=<connection port number> --name=<load-balancer-name> --type=LoadBalancer -n <kubernetes namespace>`
5250

53-
kubectl -n bdc expose pod master-2 --port=1533 --name=mymaster-2 --type=LoadBalancer
54-
```
51+
The examples in this article use the following values:
5552

56-
You should see an output similar to this:
57-
58-
```
59-
service/mymaster-0 exposed
53+
- `<pod-name>`: `master-#`
54+
- `<connection port number>`: `1533`
55+
- `<load-balancer-name>`: `mymaster-#`
56+
- `<kubernetes namespace>`: `mssql-cluster`
6057

61-
service/mymaster-1 exposed
58+
Update the following script for your environment, and run the commands:
6259

63-
service/mymaster-2 exposed
64-
```
60+
```bash
61+
kubectl expose pod master-0 --port=1533 --name=mymaster-0 --type=LoadBalancer -n mssql-cluster
62+
kubectl expose pod master-1 --port=1533 --name=mymaster-1 --type=LoadBalancer -n mssql-cluster
63+
kubectl expose pod master-2 --port=1533 --name=mymaster-2 --type=LoadBalancer -n mssql-cluster
64+
```
65+
66+
`kubectl` returns the following output.
67+
68+
```bash
69+
service/mymaster-0 exposed
70+
service/mymaster-1 exposed
71+
service/mymaster-2 exposed
72+
```
73+
74+
Each load balancer is a master replica endpoint.
75+
76+
### Enable script execution on each replica
77+
78+
1. Get the IP address for the master replica endpoint.
79+
80+
The following command returns the external IP address for the replica endpoint.
81+
82+
`kubectl get services <load-balancer-name> -n <kubernetes namespace>`
83+
84+
To get the external IP address for each replica in this scenario, run the following commands:
6585

66-
1. Connect to each master replica endpoint and enable script execution.
86+
```bash
87+
kubectl get services mymaster-0 -n mssql-cluster
88+
kubectl get services mymaster-1 -n mssql-cluster
89+
kubectl get services mymaster-2 -n mssql-cluster
90+
```
91+
92+
>[!NOTE]
93+
> It may take a little time before the external IP address is available. Run the preceding script periodically until each endpoint returns an external IP address.
94+
95+
1. Connect to the master replica endpoint and enable script execution.
6796

6897
Run this statement:
6998

@@ -73,7 +102,37 @@ If you are using SQL Server Big Data Clusters with [Always On Availability Group
73102
GO
74103
```
75104

76-
You are now ready to run Python and R scripts on the master instance of Big Data Clusters. See the quickstarts below to run your first script.
105+
For example, you can run the preceding command with `sqlcmd`. The following example connects to the master replica endpoint and enables script execution. Update the values in the script with for your environment.
106+
107+
```bash
108+
sqlcmd -S <IP address>,1533 -U <user name> -P <password> -Q "EXEC sp_configure 'external scripts enabled', 1; RECONFIGURE WITH OVERRIDE;"
109+
```
110+
111+
Repeat the step for each replica.
112+
113+
### Demonstration
114+
115+
The following image demonstrates this process.
116+
117+
:::image type="content" source="media/machine-learning-services/example-kube-enable-scripts.png" alt-text="demonstrate-configure-external-script-availability-group":::
118+
119+
You are now ready to run Python and R scripts on the master instance of Big Data Clusters. See the quickstarts under [Next steps](#next-steps) to run your first script.
120+
121+
### Delete the master replica endpoints
122+
123+
On the Kubernetes cluster, delete the endpoint for each replica. The endpoint is exposed in Kubernetes as a load-balancing service.
124+
125+
The following command deletes load-balancing service.
126+
127+
`kubectl delete svc <load-balancer-name> -n mssql-cluster`
128+
129+
For the examples in this article, run the following commands.
130+
131+
```bash
132+
kubectl delete svc mymaster-0 -n mssql-cluster
133+
kubectl delete svc mymaster-1 -n mssql-cluster
134+
kubectl delete svc mymaster-2 -n mssql-cluster
135+
```
77136

78137
## Next steps
79138

203 KB
Loading

0 commit comments

Comments
 (0)