--- orphan: true --- (mongodb-services)= # Services CrateDB and MongoDB In order to exercise this subsystem, you will need one running instance of each CrateDB and MongoDB. You can either deploy them on your workstation, or by using their managed service infrastructure. (mongodb-services-standalone)= ## Standalone Services Quickly start CrateDB and MongoDB using Docker or Podman. ### CrateDB Start CrateDB. ```shell docker run --rm -it --name=cratedb --publish=4200:4200 --env=CRATE_HEAP_SIZE=2g \ crate:5.7 -Cdiscovery.type=single-node ``` ### MongoDB Start MongoDB. Please note that change streams are only available for replica sets and sharded clusters, so let's define a replica set by using the `--replSet rs-testdrive` option when starting the MongoDB server. ```shell docker run -it --rm --name=mongodb --publish=27017:27017 \ mongo:7 mongod --replSet rs-testdrive ``` Now, initialize the replica set, by using the `mongosh` command to invoke the `rs.initiate()` operation. ```shell export MONGODB_URL="mongodb://localhost/" docker run -i --rm --network=host mongo:7 mongosh ${MONGODB_URL} <`. When shutting down your workbench, you may want to clean up any cloud resources you just used. ```shell atlas clusters delete testdrive ``` :::{todo} - Evaluate and describe how to perform the "Database Access" step using the Atlas CLI instead of using the Atlas Web Console. ::: [Atlas CLI]: https://www.mongodb.com/docs/atlas/cli/ [CrateDB Cloud]: https://cratedb.com/docs/cloud/ [croud CLI]: https://cratedb.com/docs/cloud/en/latest/tutorials/deploy/croud.html [MongoDB Atlas]: https://www.mongodb.com/atlas [CrateDB Cloud Web Console]: https://cratedb.com/docs/cloud/en/latest/tutorials/quick-start.html#deploy-cluster