In case you’re too lazy to dig into the full CloudSearch developer guide, here’s a quick summary of how to install the CloudSearch API command line tools on Linux:
- Ensure that you have a JRE/JDK installed. Most distros will ship with something like OpenJDK, which is fine. If you’d like, grab the “Oracle” JDK or JRockit (6+).
- Ensure that JAVA_HOMEis set in your environment. You’ll probably want to make sure that something like the following is in your bash config:
- Next, go download the actual Amazon CloudSearch command line tools from AWS Developer Tools.
- `tar xzf` and `mv` the cloud-search-tools-* directory into something like /opt/aws/cloud-search-tools.
- Add a CS_HOME environment variable that points at /opt/aws/cloud-search-tools. Again, unless there’s a collision, you’ll probably want this in your bash config:
- If you haven’t already done so, create an AWS_CREDENTIAL_FILEthat looks like this:
You can always grab your credentials from the security credential page. You’ll need an environment variable to tell CS where to find this as well, so open up your bash config and add another line like this:
- OK, assuming you’ve set your environment variables, you should be ready to go! Let’s test by creating a domain and checking the status:
user@host:~$ /opt/aws/cloud-search-tools/bin/cs-create-domain -d domain-name =========================================== Creating domain [domain-name] Domain endpoints are currently being created. Use cs-describe-domain to check for endpoints. user@host:~$ /opt/aws/cloud-search-tools/bin/cs-describe-domain ====================== Domain Name: domain-name (currently being activated). ======================
- Once the domain is created, you should see something like this:
user@host:~$ /opt/aws/cloud-search-tools/bin/cs-describe-domain -d domain-name === Domain Summary === Domain Name: domain-name Document Service endpoint: doc-domain-name-endpoint_id.us-east-1.cloudsearch.amazonaws.com Search Service endpoint: search-domain-name-endpoint_id.us-east-1.cloudsearch.amazonaws.com SearchInstanceType: search.m1.small SearchPartitionCount: 1 SearchInstanceCount: 1 Searchable Documents: 0 Current configuration changes require a call to IndexDocuments: No ======================