Retail:Developers Guide/How-to/How to Setup MultiServer Dev Environment For Automation
Overview
This is a quick start guide to set up an automation environment with multiserver
Prepare the environment
/etc/hosts
Add these lines to /etc/hosts
127.0.0.1 central.openbravo.com 127.0.0.1 store1.openbravo.com 127.0.0.1 store2.openbravo.com
Install apache2
Apache2 is required to test offline mode
sudo apt-get install apache2
How to install and configure the Central Server
clone openbravo and the pack
- org.openbravo.mobile.core
- org.openbravo.retail.config
- org.openbravo.retail.discounts
- org.openbravo.retail.pack
- org.openbravo.retail.poshwmanager
- org.openbravo.retail.posterminal
- org.openbravo.retail.returns
- org.openbravo.retail.sampledata
clone these extra modules
- org.openbravo.replication.symmetricds
- org.openbravo.retail.sampledata.multiserver
- org.openbravo.retail.storeserver.synchronization
ant setup
openbravo.properties. add or change to
authentication.class=org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager test.environment=true mobile.server.key=Central
ant install.source
install symmetric.ds (always after install.source and only in the Central server)
ant -f modules/org.openbravo.replication.symmetricds/build.xml install.symmetric.ds
validate and export store's data
ant -f modules/org.openbravo.replication.symmetricds/build.xml validate.store.data -DmobileServerKey=Store1 ant -f modules/org.openbravo.replication.symmetricds/build.xml validate.store.data -DmobileServerKey=Store2 ant -f modules/org.openbravo.retail.storeserver.synchronization/build.xml export.store.data -DmobileServerKey=Store1 -DoutputDirectory=../storeServer1Module ant -f modules/org.openbravo.retail.storeserver.synchronization/build.xml export.store.data -DmobileServerKey=Store2 -DoutputDirectory=../storeServer2Module
add the projects to eclipse, add the server, verify that there are no errors
if any error shows up, first install.source the pack, then add the 3 multiserver modules, then install.source again, then install sym_ds
in the server, change the port to 9005, 9080, 9009
How to install and configure the Store servers
Store1
clone openbravo. Add this modules (same as central but without the org.openbravo.retail.sampledata)
- org.openbravo.mobile.core
- org.openbravo.retail.config
- org.openbravo.retail.discounts
- org.openbravo.retail.pack
- org.openbravo.retail.poshwmanager
- org.openbravo.retail.posterminal
- org.openbravo.retail.returns
clone these extra modules
- org.openbravo.replication.symmetricds
- org.openbravo.retail.storeserver.synchronization
in the openbravo directory
cd openbravo rm -rf referencedata/sampledata/F_B_International_Group referencedata/sampledata/QA_Testing
and
copy /storeServer1Module to openbravo/modules/
ant setup
in the openbravo.properties
authentication.class=org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager test.environment=true mobile.server.key=Store1
install.source
add these stores projects to another eclipse
Store2
follow the same Store steps but
- copying storeServer2Module to the modules folder
- set mobile.server.key=Store2 in the Openbravo.properties
Run
1. start the central server
- if there is a permgem error, add -XX:MaxPermSize=512m to the server configuration
- log in as Openbravo/openbravo role The White Valley
- open the Mobile Servers window
- open the Central record
- be sure that the "Can be registered" option is flagged
- in the store servers, remove the port (:8080) off the url
2. start the store server 1 after the central has finished starting
- log in as Openbravo/openbravo role The White Valley
- open the Mobile Servers window
- open the Central record
- in the store servers, remove the port (:8080) off the url
Verify
symetric.ds tables
execute this query:
SELECT * FROM sym_node
verify that it returns central, store1 and store2
Sales Order
Create a sales order in the Central server
Verify that the sales order has been transferred to the store server
How to work in offline mode
Configure apache2
Modify the configuration of the openbravo-jk-mount.conf file for apache2, to filter 'openbravo' requests
cd /etc/apache2/conf-enabled nano openbravo-jk-mount.conf jkMount /openbravo* ajp13_worker jkMount /* ajp13_worker JkMountCopy all
And enable the configuration
sudo a2enconf openbravo-jk-mount.conf
Avoid using port in the url
In the OpenbravoERPTest.properties of the Store1 and Store2, do not set the port in the url
openbravo.url=http://store1.openbravo.com/
Troubleshooting
Rules to follow
- always start the central server before the stores
- never remove symetric.ds while the servers are running
- never install.source while the servers are running
- for offline: the addresses in the database (ERP White Valley role - Mobile Servers - store1 and store2 should not have the 8080 because apache does only block 80) and in the openbravoERPTest.properties must be the same
POS showing the "transition to offline" pop up
set the correct server addresses, see rules to follow above
The server cannot synchronize. ERRORs in the console
uninstall symetricds from all servers and install it only in the central server
- stop tomcat in all servers
- ant uninstall.symmetric.ds in all servers
- ant install.symmetric.ds only in the central
- start tomcat in central
- wait until the server is up and running
- start tomcat in the stores
ERROR org.jumpmind.symmetric.service.impl.AcknowledgeService - Could not find batch Store2-xxx to acknowledge as OK
SELECT * FROM sym_outgoing_batch where batch_id IN (xxx) DELETE FROM sym_outgoing_batch WHERE batch_id IN (xxx) DELETE FROM sym_data_event WHERE batch_id IN (xxx)
WARN org.jumpmind.symmetric.service.impl.PushService - Registration was not open at MainServer:Central:Central
- uninstall symetricds from all servers
- install in the central
- start central
- start store
permsize error
add to the tomcat server properties
-XX:MaxPermSize=512m
symetricds cannot synchronize a record
if symetricds cannot synchronize a record, set the record as IG (ignore)
UPDATE sym_outgoing_batch SET status = 'IG' WHERE status = 'ER'