Cluster Management

Opensolr Cluster Management — find answers to your questions

API - Create Resilient Cluster

API Endpoint

Create Resilient Cluster

Create a new Resilient Cluster in your Opensolr environment. A Resilient Cluster provides high availability with automatic failover across multiple replicas. You must have a cluster environment provisioned on your corporate account before you can create clusters.

Endpoint

GET https://opensolr.com/solr_manager/api/create_cluster

Parameters

ParameterStatusDescription
emailrequiredYour Opensolr registration email address
api_keyrequiredYour Opensolr API key
cluster_namerequiredThe name for your new cluster
master_serverrequiredThe cluster environment region identifier (e.g. FRANKFURT_GERMANY). Use the Get Available Regions API to see available options.
http_usernameoptionalHTTP Auth username for increased security on your cluster
http_passwordoptionalHTTP Auth password for increased security on your cluster
Prerequisite: You must have a cluster environment provisioned on your corporate account before you can add new clusters. Learn more about Resilient Clusters.

Code Examples

$_ cURL

curl -s "https://opensolr.com/solr_manager/api/create_cluster?email=YOUR_EMAIL&api_key=YOUR_API_KEY&cluster_name=prod_cluster&master_server=FRANKFURT_GERMANY"

PHP PHP

$params = http_build_query([
    'email'         => 'YOUR_EMAIL',
    'api_key'       => 'YOUR_API_KEY',
    'cluster_name'  => 'prod_cluster',
    'master_server' => 'FRANKFURT_GERMANY',
    'http_username' => 'my_user',     // optional
    'http_password' => 'my_password', // optional
]);
$response = json_decode(file_get_contents(
    'https://opensolr.com/solr_manager/api/create_cluster?' . $params
), true);
print_r($response);

Py Python

import requests

response = requests.get(
    "https://opensolr.com/solr_manager/api/create_cluster",
    params={
        "email": "YOUR_EMAIL",
        "api_key": "YOUR_API_KEY",
        "cluster_name": "prod_cluster",
        "master_server": "FRANKFURT_GERMANY",
        "http_username": "my_user",     # optional
        "http_password": "my_password", # optional
    }
)
data = response.json()
print(data)

Related Documentation

Resilient Clusters

Learn about Opensolr Resilient Clusters with automatic failover and high availability.

Create Index

Create a new standalone Solr index via the API.

Available Regions

Get a list of all server regions where you can create indexes and clusters.

Need a custom cluster setup or dedicated infrastructure? Let us know.

Contact Support
Read Full Answer

API - Delete a Dedicated Environment

Cluster Management API

Delete a Dedicated Environment

Tears down a dedicated environment you provisioned (one of your cluster_owned_environments in get_env): every server in it and its load balancer are decommissioned by a background job. Shared Opensolr environments cannot be deleted.

Endpoint

GET https://opensolr.com/solr_manager/api/delete_environment

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key (master key, or a scoped key that allows this endpoint)
env_nameRequiredThe environment tag name exactly as returned by get_env (cluster_owned_environments[].server_identifier)

How It Works

Ownership of the environment is checked first; a mismatch answers Not Owner! and nothing is queued. Otherwise a delete_env job is created and processed by the Opensolr job runner, which removes the servers, the load balancer and their DNS records and stops billing for them. Indexes still living in that environment are destroyed with it — move or back them up first (create_backup, then replicate_index into another environment).

Irreversible. There is no undo once the job runs. The call itself only queues the job; use the control panel’s Environments page to watch its progress.

Response

KeyTypeDescription
on successHTTP 200 with an empty body — the deletion job has been queued
on errorPlain-text Not Owner! followed by Please fix the errors above! when the environment is not yours or the name is unknown

Code Examples

$_ cURL

curl -s "https://opensolr.com/solr_manager/api/delete_environment?email=YOUR_EMAIL&api_key=YOUR_API_KEY&env_name=MY-ENV-TAG"

PHP PHP

$q = http_build_query(['email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'env_name' => 'MY-ENV-TAG']);
echo file_get_contents("https://opensolr.com/solr_manager/api/delete_environment?{$q}");

Py Python

import requests

r = requests.get("https://opensolr.com/solr_manager/api/delete_environment",
                 params={"email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "env_name": "MY-ENV-TAG"}, timeout=30)
print(r.text)

Example Response

(empty body  job queued)

# or, when the environment is not yours:
Not Owner!
Please fix the errors above!

Use Cases

  • Tear down a temporary load-test or staging environment from CI when the run ends
  • Decommission a region you no longer serve
  • Clean up after migrating indexes to a newer Solr environment

Related Documentation

Need help with the Opensolr API? We are here to help.

Contact Support
Read Full Answer