- download and install the cf cli
- download the appropriate bluemix-cloudant-replicator binary
- install the plugin via cf install-plugin PATH_TO_PLUGIN_BINARY
- if you get a permission error run: chmod +x PATH_TO_PLUGIN_BINARY on the binary
- verify the plugin installed by looking for it with cf plugins
If you've already installed the plugin and are updating, run cf uninstall-plugin bluemix-cloudant-replicator before the install.
cf cloudant-replicate [-a APP] [-d DATABASE] [-p PASSWORD] [--all-dbs] [--create]
The plugin will
PASSWORDto log into each of the different Bluemix regions (using the org and space names of the current target)
- Retrieve the credentials from the first Cloudant service instance bound to
APPin each region
- Create all selected databases(from -d or --all-dbs) that are non-existing if --create is passed
- Set up continuous replication between the database names passed via
DATABASE(comma-separated) or between all databases when --all-dbs is passed
If you call the command with no arguments, it will interactively prompt you to choose your app and databases from your current cf target. The interactive mode will guide you to your app in each region if necessary.
Running the command will create pair-wise replications between the databases in each region, as shown in the image below.
##Notes and Assumptions
- The specified app exists in all regions
- The same org and space name are used across regions (this is not a problem when using the interactive mode)
- There is only one Cloudant service bound to the app (the first set of credentials will be used if not)
- Each Cloudant service has a database by the same name as the original
Configuring continuous replication will result in frequent API calls between the configured regions. With the default ("Shared") plan on Bluemix, these calls will count toward the totals on your monthly bill. Consider setting Spending notifications to avoid unexpected charges. Alternatively, consider upgrading to an Enterprise plan that is better suited for the continuous replication feature.
There may be a case where you do not want to use all locations or you may want to add additional endpoints. To do this, you must fork the project and modify ENDPOINTS(found in bc-replicator.go). When you do this, it is up to you to recompile the code and re-install the plugin following the same instructions found above. The only difference is you will now point install-plugin to the newly compiled binary path.
This plugin was developed to help automate 'Step 3. Configure Cloudant replication' in this article.
There is no documentation for this package.