Skip to content

Commit 59e4327

Browse files
committed
CTP 3.2 updates
1 parent 4f42994 commit 59e4327

11 files changed

Lines changed: 504 additions & 41 deletions

File tree

samples/features/sql-big-data-cluster/data-virtualization/oracle/customer-oracle.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ GO
4949
SELECT pr.pr_item_sk, pc.pr_review_content, pr.pr_user_sk AS customerid
5050
FROM dbo.product_reviews as pr
5151
JOIN (SELECT TOP(100) * FROM dbo.product_reviews_hdfs_csv) AS pc ON pc.pr_review_sk = pr.pr_review_sk
52-
JOIN dbo.customer_ora AS c ON c.c_customer_sk = pr.pr_user_sk
52+
JOIN dbo.customer_ora AS c ON c.C_CUSTOMER_SK = pr.pr_user_sk
5353
JOIN dbo.item AS i ON i.i_item_sk = pr.pr_item_sk
5454
INNER JOIN (
5555
SELECT

samples/features/sql-big-data-cluster/data-virtualization/oracle/inventory-oracle.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ IF NOT EXISTS(SELECT * FROM sys.external_data_sources WHERE name = 'OracleSalesS
2020
-- As a result, the names are case-sensitive so specify the name in the external table definition
2121
-- that matches the exact case of the table and column names in the Oracle metadata.
2222
CREATE EXTERNAL TABLE [inventory_ora]
23-
([inv_date] DECIMAL(10,0) NOT NULL, [inv_item] DECIMAL(10,0) NOT NULL,
24-
[inv_warehouse] DECIMAL(10,0) NOT NULL, [inv_quantity_on_hand] DECIMAL(10,0))
23+
([INV_DATE] DECIMAL(10,0) NOT NULL, [INV_ITEM] DECIMAL(10,0) NOT NULL,
24+
[INV_WAREHOUSE] DECIMAL(10,0) NOT NULL, [INV_QUANTITY_ON_HAND] DECIMAL(10,0))
2525
WITH (DATA_SOURCE=[OracleSalesSrvr],
2626
LOCATION='<oracle_service_name,nvarchar(30),xe>.SALES.INVENTORY');
2727
GO
2828

2929
-- Find quantity of certain items from inventory for a specific category
3030
--
31-
SELECT TOP(100) w.w_warehouse_name, i.inv_item, SUM(i.inv_quantity_on_hand) as total_quantity
31+
SELECT TOP(100) w.w_warehouse_name, i.INV_ITEM, SUM(i.INV_QUANTITY_ON_HAND) as total_quantity
3232
FROM [inventory_ora] as i
3333
JOIN item as it
34-
ON it.i_item_sk = i.inv_item
34+
ON it.i_item_sk = i.INV_ITEM
3535
JOIN warehouse as w
36-
ON w.w_warehouse_sk = i.inv_warehouse
37-
WHERE it.i_category = 'Movies & TV' and i.inv_item BETWEEN 17401 and 17402 --> get items within specific range
38-
GROUP BY w.w_warehouse_name, i.inv_item;
36+
ON w.w_warehouse_sk = i.INV_WAREHOUSE
37+
WHERE it.i_category = 'Movies & TV' and i.INV_ITEM BETWEEN 17401 and 17402 --> get items within specific range
38+
GROUP BY w.w_warehouse_name, i.INV_ITEM;
3939
GO
4040

4141
-- Cleanup

samples/features/sql-big-data-cluster/data-virtualization/storage-pool/web-clickstreams-hdfs-parquet.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ AS
9090
AND w.wcs_user_sk IS NOT NULL)
9191
GROUP BY w.wcs_user_sk
9292
) AS q
93-
INNER JOIN customer as c ON q.wcs_user_sk = c.c_customer_sk
94-
INNER JOIN customer_demographics as cd ON c.c_current_cdemo_sk = cd.cd_demo_sk;
93+
INNER JOIN customer_ora as c ON q.wcs_user_sk = c.C_CUSTOMER_SK
94+
INNER JOIN customer_demographics as cd ON c.C_CURRENT_CDEMO_SK = cd.cd_demo_sk;
9595
GO
9696

9797

samples/features/sql-big-data-cluster/deployment/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
SQL Server 2019 big data cluster is deployed as docker containers on a Kubernetes cluster. These samples provide scripts that can be used to provision a Kubernetes clusters using different environments.
55

6-
## Create a Kubernetes cluster using Kubeadm on Ubuntu 16.04 LTS or 18.04 LTS
6+
## Deploy a Kubernetes cluster using kubeadm
77

8-
Use the scripts in the **kubeadm** folder to deploy Kubernetes over multiple Linux machines (physical or virtualized) using `kubeadm` utility.
8+
Use the scripts in the **kubeadm** folder to deploy a Kubernetes cluster over one or more Linux machines (physical or virtualized) using `kubeadm` utility.
99

10-
## Deploy a SQL Server big data cluster on Azure Kubernetes Service (AKS)
10+
## Deploy a SQL Server big data cluster on Azure Kubernetes Service (AKS)
1111

12-
Using the sample Python script in **aks** folder, you will deploy a Kubernetes cluster in Azure using AKS and a SQL Server big data cluster using on top of it.
12+
Using the sample Python script in **aks** folder, you will deploy a Kubernetes cluster in Azure using AKS and a SQL Server big data cluster using on top of it.
1313

1414
## Push SQL Server big data cluster images to your own private Docker repository
1515

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
# Create a Kubernetes cluster using Kubeadm on Ubuntu 16.04 LTS or 18.04 LTS
22

33

4-
In this example, we will deploy Kubernetes over multiple Linux machines (physical or virtualized) using kubeadm utility. These instructions have been tested primarily with Ubuntu 16.04 LTS & 18.04 LTS versions.
4+
## __[ubuntu](ubuntu/)__
55

6-
## Pre-requisites
6+
This folder contains scripts that provide a template for deploying a Kubernetes cluster using kubeadm on one or more Linux machines.
77

8-
1. Multiple Linux machines or virtual machines. Recommended configuration is 8 CPUs, 32 GB memory each and at least 100 GB storage for each machine. Minimum number of machines required is three machines
9-
1. Designate one machine as the Kubernetes master
10-
1. Rest of the machines will be used as the Kubernetes agents
8+
## __[ubuntu-single-node-vm](ubuntu-single-node-vm/)__
119

12-
**NOTE: Ensure there is sufficient local storage on your agents. Each volume will use up to 10GB by default. The script creates 25 volumes. Not all of the volumes will be used since it depends on the number of pods being deployed on each agent node. It is recommended to have at least 200 GB of storage on the agent nodes**
13-
14-
### Useful resources
15-
16-
[Deploy SQL Server 2019 big data cluster on Kubernetes](https://docs.microsoft.com/en-us/sql/big-data-cluster/deployment-guidance?view=sqlallproducts-allversions)
17-
18-
[Creating a cluster using kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)
19-
20-
[Troubleshooting kubeadm](https://kubernetes.io/docs/setup/independent/troubleshooting-kubeadm/)
21-
22-
### Instructions
23-
24-
1. Start a sudo shell context
25-
1. Execute [ubuntu/setup-k8s-prereqs.sh](ubuntu/setup-k8s-prereqs.sh/) script on each machine
26-
1. Execute [ubuntu/setup-k8s-master.sh](ubuntu/setup-k8s-master.sh/) script on the machine designated as Kubernetes master
27-
1. After successful initialization of the Kubernetes master, follow the kubeadm join commands output by the setup script on each agent machine
28-
1. Execute [ubuntu/setup-volumes-agent.sh](ubuntu/setup-volumes-agent.sh/) script on each agent machine to create volumes for local storage
29-
1. Execute ***kubectl apply -f ubuntu/local-storage-provisioner.yaml*** against the Kubernetes cluster to create the local storage provisioner.
30-
1. Now, you can deploy the SQL Server 2019 big data cluster following instructions [here](https://docs.microsoft.com/en-us/sql/big-data-cluster/deployment-guidance?view=sqlallproducts-allversions)
10+
This folder contains a sample script that can be used to deploy a single-node Kubernetes cluster on a Linux machine.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
# Deploy a SQL Server big data cluster on single node Kubernetes cluster (kubeadm)
3+
4+
Using this sample bash script, you will deploy a single node Kubernetes cluster using kubeadm and a SQL Server big data cluster on top of it. The script must be run from the VM you are planning to use for your kubeadm deployment.
5+
6+
## Pre-requisites
7+
8+
1. A vanilla Ubuntu 16.04 or 18.04 VM. All dependencies will be setup by the script. Using Azure Linux VMs is not yet supported.
9+
1. VM should have at least 8CPUs, 64GB RAM and 100GB disk space.After installing the images you will be left with 50GB for data/logs across all components.
10+
11+
## Instructions
12+
13+
1. Download the script on the VM you are planning to use for the deployment
14+
15+
```
16+
17+
curl --output kickstarter-azdata.sh http://rima-5.guest.corp.microsoft.com/kickstarter-azdata.sh
18+
```
19+
20+
1. Make the script executable
21+
22+
```
23+
24+
chmod +x kickstarter-azdata.sh
25+
```
26+
27+
1. Run the script (make sure you are running with sudo)
28+
29+
```
30+
31+
sudo ./kickstarter-azdata.sh
32+
```
33+
34+
1. Refresh alias setup for azdata
35+
36+
```
37+
38+
source ~/.bashrc
39+
```
40+
41+
When prompted, provide your input for the password that will be used for all external endpoints: controller, SQL Server master and gateway. The password should be sufficiently complex based on existing rules for SQL Server password. The controller username is defaulted to *admin*.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
if [ "$EUID" -ne 0 ]
4+
then echo "Please run as root"
5+
exit
6+
fi
7+
DIR_PREFIX=$1
8+
9+
kubeadm reset --force
10+
11+
systemctl stop kubelet
12+
rm -rf /var/lib/cni/
13+
rm -rf /var/lib/etcd/
14+
rm -rf /run/flannel/
15+
rm -rf /var/lib/kubelet/*
16+
rm -rf /etc/cni/
17+
rm -rf /etc/kubernetes/*
18+
ip link set cni0 down
19+
#brctl delbr cni0
20+
ip link set flannel.1 down
21+
#brctl delbr flannel.1
22+
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
23+
24+
rm -rf .azdata/
25+
26+
SERVICE_STOP_FAILED=0
27+
28+
systemctl | grep "/var/lib/kubelet/pods" | while read -r line; do
29+
30+
# Retrieve the mount path
31+
#
32+
MOUNT_PATH=`echo "$line" | grep -v echo | egrep -oh -m 1 "(/var/lib/kubelet/pods).+"`
33+
34+
if [ -z "$MOUNT_PATH" ]; then
35+
continue
36+
fi
37+
38+
if [[ ! -d "$MOUNT_PATH" ]] && [[ ! -f "$MOUNT_PATH" ]]; then
39+
40+
SERVICE=$(echo $line | cut -f1 -d' ')
41+
42+
echo "Mount "$MOUNT_PATH" no longer exists."
43+
echo "Stopping orphaned mount service: '$SERVICE'"
44+
45+
systemctl stop $SERVICE
46+
47+
if [ $? -ne 0 ]; then
48+
SERVICE_STOP_FAILED=1
49+
fi
50+
51+
echo ""
52+
fi
53+
done
54+
55+
if [ $SERVICE_STOP_FAILED -ne 0 ]; then
56+
echo "Not all services were stopped successfully. Please check the above output for more inforamtion."
57+
else
58+
echo "All orphaned services successfully stopped."
59+
fi
60+
61+
for i in $(seq 1 30); do
62+
63+
vol="vol$i"
64+
65+
sudo umount /mnt/local-storage/$vol
66+
67+
sudo rm -rf /mnt/local-storage/$vol
68+
69+
done
70+
71+
72+
kubeadm reset -y
73+
sudo apt-get -y purge kubeadm kubectl kubelet kubernetes-cni kube*
74+
sudo apt-get autoremove
75+
sudo rm -rf ~/.kube

0 commit comments

Comments
 (0)