|
24 | 24 | "## **Steps**\r\n", |
25 | 25 | "1. [Create a Twitter Developer Account](https://developer.twitter.com/en/apply-for-access.html).\r\n", |
26 | 26 | "2. Setup\r\n", |
27 | | - " 1. Create 'TwitterData' database.\r\n", |
| 27 | + " 1. Create 'TwitterData' database and retrieve server hostname.\r\n", |
28 | 28 | " 2. Change kernel from \"SQL\" to \"Spark | Scala\".\r\n", |
29 | 29 | " 3. Import packages.\r\n", |
30 | 30 | " 4. Enter required parameters.\r\n", |
|
53 | 53 | "cell_type": "markdown", |
54 | 54 | "source": [ |
55 | 55 | "## **2. Setup**\n", |
56 | | - "1. Create a database in the SQL Server master instance called 'TwitterData'.\n", |
| 56 | + "1. Create a database in the SQL Server master instance called 'TwitterData', and retrieve server hostname. \n", |
57 | 57 | "2. Change the Kernel from \"SQL\" to \"Spark | Scala\".\n", |
58 | 58 | "3. Import Java packages.\n", |
59 | 59 | "4. Specify setup parameters" |
|
65 | 65 | { |
66 | 66 | "cell_type": "markdown", |
67 | 67 | "source": [ |
68 | | - "### **2.1 Create TwitterData Database**" |
| 68 | + "### **2.1 Create TwitterData Database and Retrieve Hostname**" |
69 | 69 | ], |
70 | 70 | "metadata": { |
71 | 71 | "azdata_cell_guid": "196dd8cd-e4d7-45c7-b6f8-21dde6c75ae7" |
|
89 | 89 | "outputs": [], |
90 | 90 | "execution_count": 0 |
91 | 91 | }, |
| 92 | + { |
| 93 | + "cell_type": "markdown", |
| 94 | + "source": [ |
| 95 | + "Use the following cell to check your server name. If it returns ```master-0```, your hostname will be ```master-0.master-svc```. You will define this value in the Parameters section." |
| 96 | + ], |
| 97 | + "metadata": { |
| 98 | + "azdata_cell_guid": "02e6cd9a-ef88-419c-afa0-e6a666f1070e" |
| 99 | + } |
| 100 | + }, |
| 101 | + { |
| 102 | + "cell_type": "code", |
| 103 | + "source": [ |
| 104 | + "SELECT @@Servername;" |
| 105 | + ], |
| 106 | + "metadata": { |
| 107 | + "azdata_cell_guid": "0827942d-a223-4ba8-8168-2fb57a4a2488" |
| 108 | + }, |
| 109 | + "outputs": [], |
| 110 | + "execution_count": 0 |
| 111 | + }, |
92 | 112 | { |
93 | 113 | "cell_type": "markdown", |
94 | 114 | "source": [ |
|
141 | 161 | "### **2.4 Parameters**\r\n", |
142 | 162 | "Enter the required parameters for the Spark streaming job to connect to SQL Server.\r\n", |
143 | 163 | "\r\n", |
144 | | - "In this example, the connection is made from Spark to the SQL Server master instance using the internal DNS name (master-9.master-svc) and port (1433). Alternatively, and especially if you are using a highly available Always On Availability Group, you can connect to the Kubernetes service that exposes the primary node of the Always On Availability Group.\r\n", |
| 164 | + "In this example, the connection is made from Spark to the SQL Server master instance using the internal DNS name (Ex: master-0.master-svc) and port (1433). Alternatively, and especially if you are using a highly available Always On Availability Group, you can connect to the Kubernetes service that exposes the primary node of the Always On Availability Group.\r\n", |
145 | 165 | "\r\n", |
146 | 166 | "#### Parameters needed to create Twitter stream\r\n", |
147 | 167 | "- Twitter API authentication keys\r\n", |
|
178 | 198 | "val password = \"password\"\r\n", |
179 | 199 | "\r\n", |
180 | 200 | "// Spark-SQL connector parameters\r\n", |
181 | | - "val hostname = \"\"\r\n", |
182 | | - "val port = 0000\r\n", |
| 201 | + "val hostname = \"master-0.master-svc\"\r\n", |
| 202 | + "val port = 1433\r\n", |
183 | 203 | "val database = \"TwitterData\"\r\n", |
184 | 204 | "val url = s\"jdbc:sqlserver://${hostname}:${port};database=${database};user=${user};password=${password};\"\r\n", |
185 | 205 | "val dbtable = \"Tweets\"\r\n", |
|
0 commit comments