This is a template to deploy an Elasticsearch cluster with OpenStackHeat on the Rackspace Cloud. This template uses chef-solo to configure the servers.
- A Heat provider that supports the following:
- OS::Nova::KeyPair
- OS::Heat::RandomString
- Rackspace::Cloud::Network
- Rackspace::Cloud::LoadBalancer
- OS::Heat::ResourceGroup
- An OpenStack username, password, and tenant id.
- python-heatclient
>= v0.2.8
:
pip install python-heatclient
We recommend installing the client within a Python virtual environment.
Here is an example of how to deploy this template using the python-heatclient:
heat --os-username <OS-USERNAME> --os-password <OS-PASSWORD> --os-tenant-id \
<TENANT-ID> --os-auth-url https://identity.api.rackspacecloud.com/v2.0/ \
stack-create elasticsearch-stack -f elasticsearch.yaml \
-P es_node_count=4
- For UK customers, use
https://lon.identity.api.rackspacecloud.com/v2.0/
as the--os-auth-url
.
Optionally, set environmental variables to avoid needing to provide these values every time a call is made:
export OS_USERNAME=<USERNAME>
export OS_PASSWORD=<PASSWORD>
export OS_TENANT_ID=<TENANT-ID>
export OS_AUTH_URL=<AUTH-URL>
Parameters can be replaced with your own values when standing up a stack. Use
the -P
flag to specify a custom parameter.
server_hostname
: Hostname for the servers (Default: elasticsearch-%index%)load_balancer_hostname
: Hostname for load balancer (Default: elasticsearch-lb)es_node_count
: Number of Elasticsearch nodes to create (Default: 2)child_template
: (Default: https://raw.githubusercontent.com/rackspace-orchestration-templates/elasticsearch/master/elasticsearch_node.yaml)es_auth_user
: User name for authentication with the Elasticsearch endpoint. A password will be automatically generated. (Default: es_user)es_version
: Version of Elasticsearch to install. (Default: 1.4.4)flavor
: Rackspace Cloud Server flavor to use. The size is based on the amount of RAM for the provisioned server. (Default: 2 GB Performance)chef_version
: Version of chef client to use (Default: 12.3.0)kitchen
: URL for the kitchen to use (Default: https://github.com/rackspace-orchestration-templates/elasticsearch)
Once a stack comes online, use heat output-list
to see all available outputs.
Use heat output-show <OUTPUT NAME>
to get the value fo a specific output.
es_url
: Elasticsearch URLes_server_ips
: Public IP addresses for the Elasticsearch nodes created.private_key
: SSH private key that can be used to login as root to the servers.es_auth_user
: userid for HTTP basic authes_password
: generated password for HTTP basic authload_balancer_ip
: Public IP address of the cloud load balancer
For multi-line values, the response will come in an escaped form. To get rid of
the escapes, use echo -e '<STRING>' > file.txt
. For vim users, a substitution
can be done within a file using %s/\\n/\r/g
.
Each elasticsearch instance is proxied via nginx on port 8080, with HTTP basic
authentication, a userid as configured by the parameter es_auth_user
, and
a random password generated by the Heat engine.
The load balancer is configured to accept connections on port 8080 and distribute connections round-robin to the Elasticsearch nodes.
There are substantial changes still happening within the OpenStack Heat project. Template contribution guidelines will be drafted in the near future.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.