Community Blog Deploy and Run Apache OFBiz on Alibaba Cloud with ApsaraDB RDS for MySQL

Deploy and Run Apache OFBiz on Alibaba Cloud with ApsaraDB RDS for MySQL

This tutorial shows you how to run Apache OFBiz on Alibaba Cloud with ApsaraDB RDS for MySQL.

This tutorial shows you how to run Apache OFBiz on Alibaba Cloud with ApsaraDB RDS for MySQL.

You can access all the tutorial resources, including deployment script (Terraform), related source code, sample data, and instruction guidance, from the GitHub project: https://github.com/alibabacloud-howto/opensource_with_apsaradb/tree/main/apache-superset

For more tutorials around Alibaba Cloud Database, please refer to: https://github.com/alibabacloud-howto/database


Apache OFBiz is an open source enterprise resource planning (ERP) system. It provides a suite of enterprise applications that integrates and automates many of the business processes of an enterprise.

To enhance Apache OFBiz with a high availability database, we will show you the steps of deploying and working with Alibaba Cloud ApsaraDB RDS for MySQL database.

By default OFBiz includes and is configured for an embedded Java database called Derby. This is a great database for demos, testing, development, and even small-scale production environments. There are many databases that OFBiz can use, both commercial and open source.

While there are significant production instances of OFBiz running using Oracle, MS SQL Server, and so on, we generally recommend using an open source database such as PostgreSQL or MySQL. The choice of database is an important decision and may have future impacts on your implementation. If you do not have a preferred database choice then we strongly recommend discussing options with an experienced consultant before making a final decision.

In this tutorial, we will show the case of using RDS MySQL high availability edition to replace the Derby for more stable production purpose.


Deployment architecture:


Step 1. Use Terraform to Provision ECS and Database on Alibaba Cloud

Run the terraform script to initialize the resources (in this tutorial, we use RDS MySQL as backend database of OFBiz, so ECS and RDS MySQL instances are included in the Terraform script). Please specify the necessary information and region to deploy.


After the Terraform script execution finished, the ECS and RDS MySQL instance information are listed as below.


Step 2. Deploy and Set up OFBiz on ECS with RDS MySQL

Please log on to ECS with ECS EIP.

ssh root@<ECS_EIP>


Then execute the following commands to setup the Apache OFBiz.

wget https://raw.githubusercontent.com/alibabacloud-howto/opensource_with_apsaradb/main/apache-ofbiz/setup.sh
sh setup.sh

After the setup script execution finished, go to edit the property host-headers-allowed in security.properties file to add the host IP of the ECS:

cd ofbiz-framework
vim framework/security/config/security.properties 


Then edit the entityengine_backup.xml configuration file to set the backend database as RDS MySQL to replace the Derby. Edit with the RDS MySQL connection string and database accounts as shown in the following pictures.

cp framework/entity/config/entityengine.xml framework/entity/config/entityengine_backup.xml
vim framework/entity/config/entityengine.xml


Replace Derby with RDS MySQL in default, default-no-eca and test delegators as follows:

  • localderby -> localmysql
  • localderbyolap -> localmysqlolap
  • localderbytenant -> localmysqltenant


Execute the following command to build and initialize the OFBiz.

./gradlew cleanAll loadAll


Execute the following command to start the OFBiz.

./gradlew ofbiz


OFBiz now started. Please visit the following URL to visit the OFBiz now.


By default, the administrator account name is admin, password is ofbiz.


0 0 0
Share on


397 posts | 81 followers

You may also like