Pervasync in the Cloud – Setting up Pervasync with Amazon EC2 & RDS

Following is a tutorial for setting up Pervasync server in the Amazon cloud so that you can sync your mobile devices with Oracle, MySQL or SQL Server databases hosted in Amazon cloud.

 Preparing the AWS Env

1. Create an AWS account at

2. Create a Beanstalk env to have a running Tomcat instance and a RDS database instance:

Setup the DB security group so that the DB instance can be accessed from the EC2 instance where Tomcat is hosted.

3. Create your app database, schema and tables. For MS SQL Server, connect to the DB server and create a database for your application’s DB schemas and tables. The DB name will be used as value of during Pervasync setup. For Oracle you supply the DB name during DB instance creation. The DB name will be the Oracle SID to be used in DB JDBC URL. For MySQL the RDS DB name is really the schema name.

4. For MySQL, create a DB Parameter Group and set the value of parameterlog_bin_trust_function_creators to 1. Modify the MySQL instance and set its parameter group to the one with log_bin_trust_function_creators set to 1. Reboot the DB instance.

Alternately to Beanstalk, you could also directly create an EC2 instance and RDS instance. To install Java & Tomcat on your EC2 instance, see

Installing Pervasync in the AWS Env

Note: You need to substitute the host name, password etc. with yours in the following.

1. Download from

2. Copy the zip file to your Amazon EC2 instance home folder:
scp -i keypair1.pem

3. Log on to your Amazon EC2 instance
ssh -i keypair1.pem

4. From now on act as root user. Un-package the zip in /usr/share/:
sudo su root
cd /usr/share/
unzip /home/ec2-user/

5. Go to non-GUI install folder for your DB type, for example for SQL Server:
cd pervasync_server-5.0.3/util/mssql/

Edit pervasync_server_mssql.ini to supply your DB connection info:

 #== Pervasync server for MS SQL Server ==
 #== ini file for setup/uninstall ==
 #== ==
 #== Property values are needed and only needed when you run ==
 #== the setup/uninstall scripts. After you are done with ==
 #== setup/uninstall, you can erase sensitive info from this file. ==
# The JDBC URL to the Pervasync server repository database.
 # Replace "localhost" with the DB host name or IP if DB is not on the same host
 # For AWS RDS, replace "localhost" with the DB Endpoint
# The database name. Replace "master" with the database name you created for your app
# Name and password of a DB user with root privileges.
 # This user/account should be pre-existent.
 # For AWS RDS, use the master user
# PervaSync server admin user name and password. You would need to use this
 # user/password pair to login to the web-based Pervasync admin console.
 # If not already exist, a database user/schema with this name will be created
 # in Pervasync server DB repository at setup time. At un-install time, the user/schema
 # will be dropped.

6. Run the setup

7. Install Pervasync server web app to Tomcat
chown -R tomcat:tomcat /usr/share/pervasync_server-5.0.3
cp /usr/share/pervasync_server-5.0.3/config/Catalina/localhost/pervasync.xml /usr/share/tomcat7/conf/Catalina/localhost/
vi /usr/share/tomcat7/conf/Catalina/localhost/pervasync.xml

8. Log on to Pervasync web admin console

If not working, check Tomcat log:
vi /usr/share/tomcat7/logs/catalina.out

Check Pervasync log: vi /usr/share/pervasync_server-5.0.3/log/pervasync_server_mssql.log


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s