This post describes a solution for creating a distributed Fredhopper setup for a real-world Production environment. This solution is composed of the following Fredhopper instances:
PRODUCTION "PROD-ORIGIN" INSTANCES
- Fredhopper ProdOrigin Indexer (on "prod-origin-01" server)
- Fredhopper ProdOrigin Query 1 (on "prod-origin-01" server)
- Fredhopper ProdOrigin Query 2 (on "prod-origin-02" server)
PRODUCTION "PROD-REPLICATION" INSTANCES
- Fredhopper ProdReplication Indexer (on "prod-replication-01" server)
- Fredhopper ProdReplication Query 1 (on "prod-replication-01" server)
- Fredhopper ProdReplication Query 2 (on "prod-replication-02" server)
Consider all these instances running on Linux servers with the ProdOrigin and ProdReplication instances available from separate data centers.
There is no "out of the box" mechanism for replicating the published configurations (XML files) between the two Production environments. A bespoke automated script is registered on both Production Indexer instances as follows:
cd /home/fredhopper/fredhopper
./bin/deployment-agent-client set-option indexer /com/fredhopper/config/VersionControl/@customer-publish-action=/fredhopper/indexer/bin/post-publish.sh
This script copies the published business.xml to the remote instance and reloads it by invoking the http://${TARGET}:${HTTP_PORT}/fredhopper/sysadmin/reload-config.jsp?select=business URL.
In order for the script to work, a passwordless authentication must be established between the ProdOrigin and ProdReplication servers.
Parameters such as "target", "user" and "httpport" are set in the post-publish.sh script, which then uses these parameter values to invoke the replicate-smarttarget-promotions.sh script. Both these scripts are available from:
post-publish script
replicate-smarttarget-promotions script