Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Assuming you have logged into the host supporting the CM service containers, follow the steps below. Notice that in the docker run command, you specifically ask for the Elasticsearch version 6 (latest) container image, as opposed to elasticsearch:1 as you did according the the Quickstart guide.

sudo docker stop circ-scripts
sudo docker stop circ-webapp
sudo docker stop es
sudo docker rename es es-v1
sudo docker run -d --name es elasticsearch:6
sudo docker inspect es --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}"


The first two commands prepare the system for the upgrade. Stopping the CM web application is a good idea so there are no extraneous requests sent to a non-existent Elasticsearch service. Stopping the es container prepares it to be preserved in case you wish to roll back. To facilitate that, you need to rename the original container as shown in the third command.

...

As an example where Ansible is used to deploy a new ES service, your playbook might look like the following:

- name: Create ElasticSearch cluster
ec2_elasticsearch:
name: "{{ es_instance_name }}"
elasticsearch_version: "6.4"
region: "{{ aws_region }}"
instance_type: "t2.small.elasticsearch"
instance_count: 1
dedicated_master: False
zone_awareness: False
ebs: True
volume_type: "gp2"
volume_size: 10
snapshot_hour: 13
access_policies: "{{ lookup('template', 'templates/es_cluster_policies.j2', convert_data=False) | from_json }}"
register: aws_es_service
 
- set_fact:
es_endpoint: "{{ aws_es_service.response.DomainStatus.Endpoint }}"
 
- name: Display the AWS ES service URL
debug:
msg: "ES URL: https://{{ es_endpoint }}:9200"


The key data points are the instance `name` and `elasticsearch_version`. You can review your Ansible playbook, and then update version value. The `name` element is important to note only if you want to retrieve/display the endpoint value using the aws tool from the command line, as shown below. (You can also see the endpoint in the ES console in the domain's Overview tab.)

aws es describe-elasticsearch-domain --domain-name <name> --query 'DomainStatus.Endpoints' --output json


Remember that the ES URL you need to configure your CM is in the form https://<es_endpoint>:9200.

...

As an example of performing a full backup of the CM database as configured in the Quickstart guide, you could issue the following command (change the Postgres values as needed to match your implementation):

pg_dump --format=c --file=datestamp_simplified_circ_db_full.sqlc -U postgres -h 172.17.0.4 simplified_circ_db


You can specify a particular path as needed to store the output file. Also, the host IP address is an example here; it could be different depending on the order in which you started the containers. To find the IP address of the pg container in your implementation, issue the command:

sudo docker inspect pg --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}"

Step 3. Configure New Elasticsearch URL

...

Redeploy the Circulation Manager containers, and perhaps upgrade, using version 2.3.3 or greater. At the time of this writing, version 2.3.6 is the latest CM version; we use that in the example below, since, ultimately, an upgrade to version 2.3.6 is recommended prior to upgrading subsequently to the new 3.x family.) The key element here is adding the new environment variable which specifies the Elasticsearch version to use: SIMPLIFIED_ELASTICSEARCH_VERSION. This must be set to the value 6. Be sure to substitute the placeholders with your CM implementation's actual database values.

sudo docker run --name circ-webapp \
    -d -p 80:80 \
    -e SIMPLIFIED_ELASTICSEARCH_VERSION="6" \
    -e SIMPLIFIED_PRODUCTION_DATABASE='postgres://[username]:[password]@[ip_address]:[port]/[database_name]' \
    -e SIMPLIFIED_DB_TASK="auto" \
    nypl/circ-webapp:2.3.6
sudo docker run -d --name circ-scripts \
    -e TZ="US/Central" \
    -e SIMPLIFIED_ELASTICSEARCH_VERSION="6" \
    -e SIMPLIFIED_DB_TASK='auto' \
    -e SIMPLIFIED_PRODUCTION_DATABASE='postgres://[username]:[password]@[ip_address]:[port]/[database_name]' \
    nypl/circ-scripts:2.3.6


If you have deployed your Postgres database as an AWS RDS service, substitute your implementation's RDS endpoint for the [ip_address] placeholder.

...

Run the search index repair script to recreate the proper database entries and Elasticsearch index entries to support searching:

sudo docker exec -it circ-webapp /bin/bash
source env/bin/activate
bin/repair/search_index

Step 6. Exit Container

Exit the virtual environment and container. You can also logout of the host if desired.

deactivate
exit


At this point, you should have a functional CM using Elasticsearch 6. Test access and searching in your SimplyE apps to verify. If you have questions or issues along the way, post them in the Slack #devops channel.