Skip to content

Commit a87d505

Browse files
dario-vegamikebrey
andauthored
WMS ID 11632- first version (#562)
* global-microservices-springdata-nosql v0 * adding sandbox - using the latest template * Update manifest.json * Update movie-stream-demo.md doing a test to see if Dario can see it. * QA - First Review * wording changes on Intro.md changes to lab1 intro and lab 2 * wording changes on Intro.md (#2) changes to lab1 intro and lab 2 * Restructure LiveLab after DryRun * Minor modification after reorg. * wording change review many small changes across files * Preparing for final version * Update link doc GAT --------- Co-authored-by: Michael Brey <48066113+mikebrey@users.noreply.github.com>
1 parent 6461ae1 commit a87d505

File tree

86 files changed

+2218
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2218
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Clean Up
2+
3+
## Introduction
4+
5+
This lab is finished. We will delete all resources created.
6+
7+
_Estimated Time:_ 5 minutes
8+
9+
## Task 1: Delete resources created using Cloud Shell
10+
11+
In this task we will deleted the resource created using the Cloud Shell.
12+
13+
1. Open the **Cloud Shell** in the top right menu to get the Cloud Shell started.
14+
15+
![Cloud Shell](https://oracle-livelabs.github.io/common/images/console/cloud-shell.png)
16+
17+
2. Execute the following in your Cloud Shell.
18+
19+
```
20+
<copy>
21+
source ~/global-microservices-springdata-nosql/env.sh
22+
oci nosql table delete --compartment-id "$OCI_NOSQL_COMPID" --table-name-or-id Movie \
23+
--wait-for-state SUCCEEDED --wait-for-state FAILED
24+
</copy>
25+
```
26+
```
27+
<copy>
28+
cd $HOME
29+
rm -rf global-microservices-springdata-nosql
30+
rm -rf global-microservices-springdata-nosql.zip
31+
</copy>
32+
```
33+
34+
3. Exit from Cloud Shell.
35+
36+
## Task 2: Delete resources created using Console
37+
38+
39+
This task deletes the resources that got created.
40+
41+
1. On the top left, go to menu, then Databases, then under Oracle NoSQL Database, hit 'Tables'
42+
Set your compartment to 'demonosql'
43+
Click on the Test table, which will bring up the table details screen. Hit Delete.
44+
45+
![Table](./images/delete-test-table.png)
46+
47+
Deleting tables is an async operation, so you will not immediately see the results on the OCI console. Eventually the status of the tables will get changed to deleted.
48+
49+
2. On the top left, go to menu, then Developer Services and then Containers & Artifacts - Container Instances.
50+
51+
In the Container instance screen, click on the container with the name `Creating Scalable, Global Microservices with OCI, Spring Data, and NoSQL`. Under 'More actions' click on Delete.
52+
53+
![Delete Container Instance](./images/delete-ci.png)
54+
55+
Wait until the status changed from 'Deleting' to 'Deleted'.
56+
57+
![Delete Container Instance](./images/delete-ci-2.png)
58+
59+
## Task 3: Delete resources created using Resource Manager - terraform
60+
61+
62+
1. Clean up from the deployment. In the top left corner, hit the OCI drop down menu, then go to 'Developer Services' and then Stacks under Resource manager.
63+
64+
![Select Resource Manager Stacks](https://oracle-livelabs.github.io/common/images/console/developer-resmgr-stacks.png)
65+
66+
2. In the Stacks screen, click on the stack with the name global-microservices-springdata-nosql.zip-xxxxxx.
67+
68+
![Stack](./images/main-zip.png)
69+
70+
3. This will bring you to the stacks detail page. On that screen hit the 'Destroy' button. This will then pop up another window where you will have to hit 'Destroy' again. This process takes 1-2 minutes to run and clean everything up.
71+
72+
![Destroy Stack](./images/destroy-stack.png)
73+
74+
4. When the destroy task will show Succeeded, return to the stack page.
75+
76+
5. Click on more actions and delete stack.
77+
78+
![Delete Stack](./images/destroy-stack-2.png)
79+
80+
## Acknowledgements
81+
* **Author** - Dario Vega, Product Manager, NoSQL Product Management and Michael Brey, Director, NoSQL Product Development
82+
* **Last Updated By/Date** - Dario Vega, Product Manager, NoSQL Product Management, Michael Brey, Director, NoSQL Product Development July 2024
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Setup Global Active Tables
2+
3+
## Introduction
4+
5+
This lab picks up where Lab 4 left off. You are going to setup a GAT configuration,
6+
and deploy your application in multiple regions. Oracle NoSQL Global Active Tables
7+
provide multi-active replication of table data between geographically separated regions.
8+
9+
_Estimated Time:_ 20 minutes
10+
11+
### Objectives
12+
13+
* GAT Offers low-latency local access to data irrespective of where the data originated.
14+
15+
### Prerequisites
16+
17+
* An Oracle Free Tier, Paid Account or Green Button
18+
* Connection to the Oracle NoSQL Database Cloud Service
19+
* Working knowledge of bash shell
20+
21+
22+
## Task 1: Create a GAT
23+
24+
Before deploying the application in multiple regions, we will create replicas for `movie` table.
25+
26+
1. From the hamburger menu, click **Databases**. Under Oracle NoSQL Databases, click **Tables**.
27+
Click the **Movie** table. Under **Resources**, click **Replicas**.
28+
The list of replicas already created in the table is listed. In our case, the list start empty
29+
![list-replicas](./images/list-replicas.png)
30+
31+
2. Click on `Add replica` button.
32+
33+
3. Choose a Replication region from the list. It does not matter which one is selected. Other information does not need to be changed for this LiveLab. Click **Add Replica**.
34+
35+
![add-replica](./images/add-replica.png)
36+
37+
4. Wait few second until the deployment is created - Status will change from Updating to Active. Any data that was in the originating table (the table created in Lab 2) will be immediately pushed to the newly created replica.
38+
39+
![list-replicas](./images/list-replicas-with-new.png)
40+
41+
Click on the link for the `replica` added. It will open a new Tab with the information for the region selected.
42+
43+
5. You can query the table created as we learned in lab 3. You will have exactly the same data in both regions.
44+
45+
![ashburn-replica](./images/ashburn-replica-table.png)
46+
47+
6. Modify a row in a region and query in the other region to verify that the changes got pushed to the other region.
48+
49+
50+
## Task 2: Set up the Movie Stream Catalog Microservice in the New Region
51+
52+
We are going to set up the Movie Stream Microservice in the new region and follow similar steps to what we used in **Lab 3 - Run the Movie Stream Catalog Microservice.**
53+
54+
1. Let's get back into the Cloud Shell. We will execute in the tab on the remote region.
55+
56+
![Cloud Shell](https://oracle-livelabs.github.io/common/images/console/cloud-shell.png)
57+
58+
2. Execute the following environment setup shell script in the Cloud Shell to
59+
set up your environment. If you close/open the Cloud Shell Console, please re-execute it.
60+
61+
```shell
62+
<copy>
63+
export OCI_obo_token=$(cat $OCI_obo_token_path)
64+
source ~/global-microservices-springdata-nosql/env.sh
65+
</copy>
66+
```
67+
![Cloud Shell](./images/cloud-shell-result.png)
68+
69+
3. List the installed JDKs using the `csruntimectl java list` command. Select GraalVM for JDK 17 as the current JDK.
70+
71+
```shell
72+
<copy>
73+
csruntimectl java list
74+
</copy>
75+
```
76+
77+
```shell
78+
<copy>
79+
csruntimectl java set graalvmjdk-17
80+
</copy>
81+
```
82+
83+
## Task 3: Start the Movie Stream Catalog Microservice and look at data
84+
85+
1. Use the following maven wrapper command to start the Spring application. Execute in the Cloud Shell.
86+
87+
```shell
88+
<copy>
89+
cd ~/global-microservices-springdata-nosql/code-nosql-spring-sdk/
90+
nohup ./mvnw spring-boot:run &
91+
</copy>
92+
```
93+
**Note:** This will start the "movie" application in the background.
94+
95+
2. After you complete step 1, you can use the command tail to see the startup for the application
96+
97+
![appl-running](./images/appl-running.png)
98+
99+
```shell
100+
<copy>
101+
tail nohup.out
102+
</copy>
103+
```
104+
The `mvnw` command will compile and start the application, please wait for the message *Started DemoApplication in xx seconds*
105+
106+
3. Lets review the data created in the prior Labs. Execute in the Cloud Shell.
107+
108+
```shell
109+
<copy>
110+
curl http://localhost:8080/api/movie | jq
111+
</copy>
112+
```
113+
114+
4. Stop the application and delete temporary files
115+
116+
execute the linux command `fg` followed by CTRL-C and enter to stop the application.
117+
```shell
118+
<copy>
119+
fg
120+
</copy>
121+
```
122+
NB: you can rexecute the command `fg` to validate that there are not jobs running in background.
123+
124+
Delete the temporary files created.
125+
```shell
126+
<copy>
127+
rm nohup.out result-test.txt
128+
</copy>
129+
```
130+
131+
5. Close the tab for the remote region.
132+
133+
134+
Adding a new region and standing up the application in that region is a straight forward process. You could use the same process to extend to even more regions. You can also use the application to insert new data into your replicated region and look to see that it got properly transmitted to the other region.
135+
136+
## Task 4: Delete a remote region
137+
138+
139+
This task deletes the resources that got created.
140+
141+
1. From the hamburger menu, click Databases. Under Oracle NoSQL Databases, click Tables. Click the Movie table. Under Resources, click Replicas.
142+
The list of replicas already created in the table is listed. Click on delete
143+
144+
![Delete Region](./images/delete-region-table.png)
145+
146+
Deleting tables is an async operation, the status will get changed to deleting. Wait for the end of this operation.
147+
148+
149+
150+
You may now **proceed to the next lab.**
151+
152+
## Learn More
153+
154+
155+
* [Oracle NoSQL Database Cloud Service page](https://www.oracle.com/database/nosql-cloud.html)
156+
* [Global Active Tables in NDCS](https://docs.oracle.com/en/cloud/paas/nosql-cloud/gasnd/)
157+
158+
159+
## Acknowledgements
160+
* **Author** - Dario Vega, Product Manager, NoSQL Product Management, Michael Brey, Director, NoSQL Product Development
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)