Manage MongoDB Flex with Cloud Foundry
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
Prerequisites
Section titled “Prerequisites”- You have created a Cloud Foundry Organization: Create organizations and spaces
- You have at least one Cloud Foundry Space: Create organizations and spaces
- You have the cf CLI installed: Interact with Cloud Foundry
Create an instance
Section titled “Create an instance”You have the opportunity to create an instance directly in cf to bind your application to the service.
-
Login with the cf CLI.
Terminal window cf login -a https://api.system.01.cf.eu01.stackit.cloud --sso -
Select the org and space (if not already selected by default). You can check the available orgs and spaces with
cf orgsandcf spaces. -
Describe your service.
You describe the service properties with a JSON object. Here is an example for a minimum set of configuration elements. For further reference on how to configure the parameters, consult Create and manage instances for MongoDB Flex and Backup, restore and clone MongoDB Flex.
{"acl": {"items": ["193.148.160.0/19", "45.129.40.0/21"]},"backupSchedule": "0 10/8 * * *","storage": {"class": "premium-perf2-mongodb","size": 10},"version": "8.0"} -
Create your service with
cf create-service.Execute the
cf create-servicewith the JSON object created in step 3.Terminal window cf create-service stackit-mongodb-flex stackit-mongodb-flex-single-1.2 my-test-instance -c '{ "acl": { "items": [ "193.148.160.0/19", "45.129.40.0/21" ] },"backupSchedule": "0 10/8 * * *", "storage": { "class": "premium-perf2-mongodb", "size": 10 }, "version": "8.0" }' -
Create a service key (user). If you bind your application to the service, you create the service key during the binding.
Terminal window cf create-service-key my-test-instance my-service-key -c '{"database":"default","roles":["read"],"username":"myuser"}' -
Get the service key.
Terminal window cf service-key my-test-instance my-service-key -
Copy the URI and test the connection. To get a detailed description on how to connect to a MonoDB Flex instance, visit Connect to MongoDB Flex.
-
Reach out to the support for migrating your services. If the connection is possible, you can contact us on the Help Center.
Delete an instance
Section titled “Delete an instance”To delete a MongoDB instance, you need to execute the cf delete-service command.
cf delete-service <instance-name>