Skip to content

Commit 4d26663

Browse files
(DOCSP-23128) Tutorial Updates for Sandbox Changes (#33)
1 parent 0308457 commit 4d26663

14 files changed

+122
-267
lines changed

snooty.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ java-se = "Java Platform, Standard Edition"
3636
jconsole = "JConsole"
3737
jconsole_command = "jconsole"
3838
kafka_api_docs_base = "https://kafka.apache.org/32/"
39-
4039
write-exception-version="1"
4140
write-concern-exception-version="1"
41+
mongodb-port-mapping="35001"
42+
jmx-port-mapping="35000"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. code-block:: shell
2+
:copyable: false
3+
4+
Creating mongo1 ... done
5+
Creating zookeeper ... done
6+
Creating broker ... done
7+
Creating mongo1-setup ... done
8+
Creating connect ... done
9+
Creating shell ... done
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. note:: Port Mappings
2+
3+
The sandbox maps the following services to ports on your host
4+
machine:
5+
6+
- The sandbox MongoDB server maps to port ``{+mongodb-port-mapping+}`` on your host machine
7+
- The sandbox {+kc+} JMX server maps to port ``{+jmx-port-mapping+}`` on your host machine
8+
9+
These ports must be free to start the sandbox.

source/includes/tutorials/quickstart-clone-commands-versioned.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

source/includes/tutorials/robwma-m1-arch.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

source/includes/tutorials/stop-containers.rst

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,42 @@
1-
After you complete this tutorial, you can free resources by stopping the
2-
tutorial Docker containers and MongoDB data. Navigate to the tutorial
3-
directory "mongodb-kafka-base" that you created in the setup step and run the
4-
following command:
1+
After you complete this tutorial, free resources on your computer
2+
by stopping or removing Docker assets. You can choose to remove
3+
both the Docker containers and images, or exclusively the
4+
containers. If you remove the containers and images, you must
5+
download them again to restart your {+mkc+} development environment,
6+
which is approximately {+pipeline-size+} in size. If you
7+
exclusively remove the containers, you can reuse the images and avoid
8+
downloading most of the large files in the sample data pipeline.
9+
10+
.. tip:: More Tutorials
11+
12+
If you plan to complete any more {+mkc+} tutorials,
13+
consider removing only containers. If you don't plan
14+
to complete any more {+mkc+} tutorials, consider
15+
removing containers and images.
16+
17+
Select the tab that corresponds to the removal task you want to run.
518

619
.. tabs::
720

8-
.. tab:: Linux or Mac OS
9-
:tabid: shell
21+
.. tab:: Remove Containers and Images
22+
:tabid: remove-containers-and-images
1023

11-
.. code-block:: none
12-
:copyable: true
24+
Run the following shell command to remove the Docker containers and
25+
images for the development environment:
1326

14-
sh stop.sh
27+
.. code-block:: shell
1528
16-
.. tab:: Windows
17-
:tabid: powershell
29+
docker-compose -p mongo-kafka down --rmi all
1830
19-
.. code-block:: none
20-
:copyable: true
31+
.. tab:: Remove Containers
32+
:tabid: remove-containers
2133

22-
powershell ./stop.ps1
34+
Run the following shell command to remove the Docker containers but
35+
keep the images for the development environment:
36+
37+
.. code-block:: shell
38+
39+
docker-compose -p mongo-kafka down
2340
2441
To restart the containers, follow the same steps required to start them
2542
in the :ref:`Tutorial Setup <tutorial-setup-run-environment>`.
26-

source/monitoring.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Example - Monitor the Quick Start
141141
---------------------------------
142142

143143
The sample environment provided in the Quick Start exposes metrics
144-
on your host machine at the URI ``localhost:35000``.
144+
on your host machine at the URI ``localhost:{+jmx-port-mapping+}``.
145145

146146
To view these metrics with {+jconsole+}, perform the following actions:
147147

@@ -174,7 +174,7 @@ To view these metrics with {+jconsole+}, perform the following actions:
174174

175175
.. step:: Enter your JMX Server URI.
176176

177-
Enter the URI ``localhost:35000`` into the :guilabel:`Remote Process`
177+
Enter the URI ``localhost:{+jmx-port-mapping+}`` into the :guilabel:`Remote Process`
178178
text input box in the {+jconsole+} interface.
179179

180180
.. step:: Click :guilabel:`Connect`.

source/quick-start.txt

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ To download the sandbox, clone the tutorial repository to your development
5151
environment. Then navigate to the directory that corresponds to the quickstart
5252
tutorial. If you use bash or a similar shell, use the following commands:
5353

54-
.. include:: /includes/tutorials/quickstart-clone-commands-versioned.rst
54+
.. code-block:: bash
55+
56+
git clone https://github.com/mongodb-university/kafka-edu.git
57+
cd kafka-edu/docs-examples/mongo-kafka-base
5558

5659
Start the Sandbox
5760
-----------------
@@ -67,7 +70,7 @@ To start the sandbox run the following command from the tutorial directory:
6770

6871
.. code-block:: shell
6972

70-
docker-compose -p quickstart up -d
73+
docker-compose -p mongo-kafka up -d
7174

7275
When you start the sandbox, Docker downloads any images it needs to run.
7376

@@ -76,16 +79,9 @@ When you start the sandbox, Docker downloads any images it needs to run.
7679
After Docker downloads and builds the images, you should see the following
7780
output in your development environment:
7881

79-
.. code-block:: shell
80-
:copyable: false
81-
82-
Creating mongo1 ... done
83-
Creating zookeeper ... done
84-
Creating broker ... done
85-
Creating mongo1-setup ... done
86-
Creating connect ... done
87-
Creating shell ... done
82+
.. include:: /includes/tutorials/docker-success.rst
8883

84+
.. include:: /includes/tutorials/port-mapping-note.rst
8985

9086
Add Connectors
9187
--------------
@@ -100,14 +96,14 @@ your Docker container using the following command:
10096

10197
.. code-block:: shell
10298

103-
docker exec -it shell /bin/bash
99+
docker exec -it mongo1 /bin/bash
104100

105101
After your shell session starts, you should see the following prompt:
106102

107103
.. code-block:: none
108104
:copyable: false
109105

110-
[MongoDB Kafka Connector Quick Start]
106+
MongoDB Kafka Connector Sandbox $
111107

112108
.. _kafka-quick-start-source-connector-section:
113109

@@ -320,7 +316,7 @@ Select the tab that corresponds to the removal task you want to run.
320316

321317
.. code-block:: shell
322318

323-
docker-compose -p quickstart down --rmi 'all'
319+
docker-compose -p mongo-kafka down --rmi all
324320

325321
.. tab:: Remove Containers
326322
:tabid: remove-containers
@@ -330,7 +326,7 @@ Select the tab that corresponds to the removal task you want to run.
330326

331327
.. code-block:: shell
332328

333-
docker-compose -p quickstart down
329+
docker-compose -p mongo-kafka down
334330

335331
Next Steps
336332
----------

source/tutorials/explore-change-streams.txt

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,24 @@ Explore Change Streams
2727

2828
.. step:: Connect to the Docker Container
2929

30-
.. include:: /includes/tutorials/robwma-m1-arch.txt
31-
3230
Create two interactive shell sessions on the tutorial Docker
3331
Container, each in a separate window.
3432

35-
.. tabs::
36-
37-
.. tab:: Intel Processors
38-
:tabid: intel-cpu
39-
40-
.. code-block:: bash
41-
:caption: This command starts an interactive shell called ChangeStreamShell1
33+
Run the following command from a terminal to start an interactive shell.
4234

43-
docker run --rm --name ChangeStreamShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
44-
45-
.. code-block:: bash
46-
:caption: This command starts an interactive shell called ChangeStreamShell2
35+
.. code-block:: bash
4736

48-
docker run --rm --name ChangeStreamShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
37+
docker exec -it mongo1 /bin/bash
4938

50-
.. tab:: Apple M1 Processors
51-
:tabid: apple-m1-cpu
39+
We will refer to this interactive shell as **ChangeStreamShell1** throughout this tutorial.
5240

53-
.. code-block:: bash
54-
:caption: This command starts an interactive shell called ChangeStreamShell1
41+
Run the following command in a second terminal to start an interactive shell:
5542

56-
docker run --platform='linux/arm64' --rm --name ChangeStreamShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
43+
.. code-block:: bash
5744

58-
.. code-block:: bash
59-
:caption: This command starts an interactive shell called ChangeStreamShell2
45+
docker exec -it mongo1 /bin/bash
6046

61-
docker run --platform='linux/arm64' --rm --name ChangeStreamShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
47+
We will refer to this interactive shell as **ChangeStreamShell2** throughout this tutorial.
6248

6349
.. step:: Open a Change Stream
6450

source/tutorials/migrate-time-series.txt

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,13 @@ Migrate a Collection to a Time Series Collection
4444

4545
.. step:: Generate Sample Data
4646

47-
.. include:: /includes/tutorials/robwma-m1-arch.txt
48-
49-
Run the following command to start a Docker container that generates
47+
Run the following command to start a script in your Docker environment that generates
5048
a sample collection containing fabricated stock symbols and their prices
5149
in your tutorial MongoDB replica set:
5250

53-
.. tabs::
54-
55-
.. tab:: Intel Processors
56-
:tabid: intel-cpu
57-
58-
.. code-block:: bash
59-
60-
docker run --rm --network mongodb-kafka-base_localnet -it robwma/stockgenmongo:1.0 -c "mongodb://mongo1" -db Stocks -col PriceData
61-
62-
.. tab:: Apple M1 Processors
63-
:tabid: apple-m1-cpu
64-
65-
.. code-block:: bash
51+
.. code-block:: bash
6652

67-
docker run --platform='linux/arm64' --rm --network mongodb-kafka-base_localnet -it robwma/stockgenmongo:1.0 -c "mongodb://mongo1" -db Stocks -col PriceData
53+
docker exec -ti mongo1 /bin/bash -c "cd /stockgenmongo/ && python3 stockgen.py -db Stocks -col PriceData"
6854

6955
Once the data generator starts running, you should see the generated
7056
data that resembles the following:
@@ -80,26 +66,13 @@ Migrate a Collection to a Time Series Collection
8066

8167
.. step:: Configure the Source Connector
8268

83-
Create an interactive shell session on the tutorial Docker container
84-
downloaded for the Tutorial Setup using the following command:
85-
69+
In a seperate terminal window, create an interactive shell session on the
70+
tutorial Docker container downloaded for the Tutorial Setup using
71+
the following command:
8672

87-
.. tabs::
88-
89-
.. tab:: Intel Processors
90-
:tabid: intel-cpu
91-
92-
.. code-block:: bash
93-
94-
docker run --rm --name TimeSeriesTutorial --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
95-
96-
97-
.. tab:: Apple M1 Processors
98-
:tabid: apple-m1-cpu
99-
100-
.. code-block:: bash
73+
.. code-block:: bash
10174

102-
docker run --platform='linux/arm64' --rm --name TimeSeriesTutorial --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
75+
docker exec -it mongo1 /bin/bash
10376

10477
Create a source configuration file called ``stock-source.json`` with the
10578
following command:

0 commit comments

Comments
 (0)