(Linux)Deploy a WebSphere Commerce live environment with Docker Compose
Deploy a WebSphere Commerce live environment, on a different machine from the authoring environment and define a search_repeater and search_slave to communicate with the search master on the authoring environment.The search_repeater needs to add the authoring host’s IP address to extra_hosts, so the repeater can discover the location of the search_master.
Before beginning
- Ensure that the Docker images are loaded to your company's private Docker registry. If we are an administrator responsible for our Docker registry, see Downloading IBM provided Docker images.
- Ensure that your machine has the minimum requirements of a 2 core processor, 8 GB RAM, and 50 GB free disk space.
- Ensure that we are deploying the live environment on a different machine from the authoring environment. If we deploy the authoring and live environments on the same machine, you will encounter port conflicts.
- Prepare a Db2 database for use with WebSphere Commerce or Prepare an Oracle database.
- Load the WebSphere Commerce production database schema by setting type=production.
Procedure
- Install Docker.
- Install Docker Version 17.06 or later.
- Install Docker Compose Version 1.10 or later.
- Consider creating a Docker Unix group.
Note: Prefix sudo to Docker commands if you do not create a Docker Unix group. See Manage Docker as a non-root user.
- Download the following sample Docker Compose file based on how the database is configured.
Option Docker Compose sample Database running inside a Docker container Download the following file:
- (v9.0.0.0) (v9.0.0.1) docker-compose-live.yml
- (v9.0.0.2) docker-compose-live.yml
Note: If the link does not prompt us to save, right-click and save the file. Open the file in a source code editor to view and edit in the proper YAML format.
The YAML files are sample that assume that we are using a Db2 Docker image. Update all the parameters that are in angle brackets <>. The sample files are commented with descriptions of the parameters.
Database running on a standard server (not in a Docker container) Download the following file:
- (v9.0.0.0) (v9.0.0.1) docker-compose-live-extdb.yml
- (v9.0.0.2) docker-compose-live-extdb.yml
docker-compose-live-template.yml
Note: If the link does not prompt us to save, right-click and save the file. Open the file in a source code editor to view and edit in the proper YAML format. Update all the parameters that are in angle brackets <>. The sample files are commented with descriptions of the parameters.
(Oracle) Download the Oracle JDBC driver java/ojdbc8.jar file from the Oracle installation folder, and put it under the directory where you saved the Docker Compose file.
- In a command line interface, go to where you saved the Docker Compose file.
- Run the applicable command to deploy the Docker containers based on the Docker Compose file that you have.
docker-compose -f docker-compose-live.yml up -d
docker-compose -f docker-compose-live-extdb.yml up -d
Note:
- If the images are not already on your machine, the command downloads Docker images from our registry. The images are approximately 10 GB in total so the duration of this command depends on your Internet connection.
- Whenever our Docker virtual machine is restarted, you need to manually restart the Docker containers by rerunning this docker-compose -f <file> up -d command.
- If you loaded sample data in the database, then replicate the search index from the authoring environment.
- Send the following REST request (POST) and add basic authentication with login as spiuser and the password for the spiuser. We can replicate the search index using one of the following methods:
- By using cURL if you have cURL installed. Use the following cURL command with the spiuser plain text password.
curl -k -u spiuser:spiuserPassword-X POST http://<search_repeater_hostname>:3737/search/admin/resources/index/replicate
- By using a browser plug-in such as HttpRequester (for Mozilla Firefox) or Postman (for Google Chrome). Use the following URL and authenticate with user spiuser and the spiuser plain text password.
http://<search_repeater_hostname>:3737/search/admin/resources/index/replicate
- Check the index status by issuing the following statusCheck command. A return status of OK means replication is successful.
http://search_repeater_hostname:3737/solr/MC_10001_CatalogEntry_en_US/operation?command=statusCheckExample REST response:
{ "responseHeader":{ "status":0, "QTime":18}, "command":"statusCheck", "status":"OK", "Detailed Status":[ "Start Time","2018-08-30T07:25:07.757Z", "isMasterReplicationEnabled",true, "isInvalidMasterError",false, "isReplicationFailed",false, "isNextExecutionAtPassed",false, "isNextExecutionAtPassed.details",[ "nextExecutionAt","Thu Aug 30 15:39:58 CST 2018", "currentDate", "Thu Aug 30 15:25:07 CST 2018"], "isMasterSlaveIndexInSync",true, "isMasterSlaveIndexInSync.details",[ "slaveIndexVersion",1535613375728, "slaveIndexGeneration",2, "masterIndexVersion",1535613375728, "masterGeneration",2], "End Time","Thu Aug 30 15:25:07 CST 2018", "Elapsed Time",0.018]}
- Check the total catentry number in the CatalogEntry index. Following is an example using the search core MC_10001_CatalogEntry_en_US response. If the numFound is not zero, the index was replicated to the slave.
http://search_repeater_hostname:3737/solr/MC_10001_CatalogEntry_en_US/select?q=*%3A*Example REST response:
{ "responseHeader":{ "status":0, "QTime":0, "params":{ "q":"*:*"}}, "response":{"numFound":3918,"start":0,"docs":[ { "catentry_id":"10001", "subscripType":"NONE
- Ensure that we can log in to the Management Center.
- https://<transaction_server_hostname>:8000/lobtools/cmc/ManagementCenter
- Ensure that we can visit the sample Aurora store.
- https://<store_server_hostname>:8443/wcs/shop/en/auroraesite
Related concepts
Extract and load data
Run Engine commands
Related tasks
Building custom Docker images based on customization packages
Use the Management Center
Running utilities from the Utility server Docker container
Related reference
Propagating the search index