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 http://aws.amazon.com/ec2/
2. Create a Beanstalk env to have a running Tomcat instance and a RDS database instance: http://aws.amazon.com/elasticbeanstalk/.
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 pervasync.server.db.database.name 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 pervasync_server-5.0.3.zip from
2. Copy the zip file to your Amazon EC2 instance home folder:
scp -i keypair1.pem pervasync_server-5.0.3.zip firstname.lastname@example.org:/home/ec2-user
3. Log on to your Amazon EC2 instance
ssh -i keypair1.pem email@example.com
4. From now on act as root user. Un-package the zip in /usr/share/:
sudo su root
5. Go to non-GUI install folder for your DB type, for example for SQL Server:
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 pervasync.server.db.url=jdbc:sqlserver://db1.cinuuz0ecpzz.us-west-2.rds.amazonaws.com:1433 # The database name. Replace "master" with the database name you created for your app pervasync.server.db.database.name=myappdb # 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.db.system.user=master pervasync.server.db.system.password=welcome1234! # 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. pervasync.server.admin.user=pvsadmin pervasync.server.admin.password=welcome1234!
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/
8. Log on to Pervasync web admin console
If not working, check Tomcat log:
Check Pervasync log: vi /usr/share/pervasync_server-5.0.3/log/pervasync_server_mssql.log