Install SymmetricDS server on an AWS instance

From JMK Wiki
Jump to navigation Jump to search

Install java

root@localhost ~ # yum install java

Download and install SymmetricDS

root@localhost ~ # cd /opt
root@localhost /opt # unzip symmetric-server-3.11.5.zip
root@localhost /opt # mv symmetric-server-3.11.5 symmetric-server
root@localhost /opt # echo "3.11.5" > symmetric-server/version.txt
root@localhost /opt # cd /opt/symmetric-server

Disable HTTP, enable HTTPS, disable JMX, adjust ports as needed

root@localhost /opt/symmetric-server # nano -w conf/symmetric-server.properties
http.enable=false
https.enable=true
jmx.http.enable=false

Decrease memory size

root@localhost /opt/symmetric-server # nano -w conf/sym_service.conf
wrapper.java.maxmemory=384
root@localhost /opt/symmetric-server # nano -w engines/aws-eu_west_1-dublin_1-bind.properties
root@localhost /opt/symmetric-server # nano -w engines/aws-us_east_1-nova_1-bind.properties
engine.name=aws-eu_west_1-dublin_1-bind
engine.name=aws-us_east_1-nova_1-bind

db.driver=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost/bind?tinyInt1isBit=false
db.user=bind
db.password=S3cr3t

registration.url=https://debra.jmk.hu:31417/sync/rita-bind
sync.url=https://dublin-1.eu-west-1.aws.jmk.hu:31417/sync/aws-eu_west_1-dublin_1-bind
sync.url=https://nova-1.us-east-1.aws.jmk.hu:31417/sync/aws-us_east_1-nova_1-bind

group.id=aws
external.id=aws-eu_west_1-dublin_1-bind
external.id=aws-us_east_1-nova_1-bind

job.purge.period.time.ms=7200000

job.routing.period.time.ms=5000
job.push.period.time.ms=10000
job.pull.period.time.ms=10000
initial.load.create.first=true
root@localhost ~ # nano -w /usr/lib/systemd/system/symmetric.service
[Unit]
Description=SymmetricDB Server
Wants=mariadb.service
After=network.target
After=mariadb.service

[Service]
Type=forking
Environment=JAVA=/bin/java
Environment=JARFILE=/opt/symmetric-server/lib/symmetric-wrapper.jar
Environment=SYM_HOME=/opt/symmetric-server
WorkingDirectory=/opt/symmetric-server

ExecStart=/bin/java -jar $JARFILE start

ExecReload=/bin/java -jar $JARFILE restart

ExecStop=/bin/java -jar $JARFILE stop

PrivateTmp=true

[Install]
WantedBy=multi-user.target
root@localhost ~ # systemctl daemon-reload
root@localhost ~ # systemctl enable symmetric.service
root@localhost ~ # systemctl list-unit-files
root@localhost ~ # systemctl start symmetric.service

On the host

root@localhost /opt/symmetric-server # bin/symadmin --engine rita-bind open-registration aws aws-eu_west_1-dublin_1-bind
root@localhost /opt/symmetric-server # bin/symadmin --engine rita-bind open-registration aws aws-us_east_1-nova_1-bind

Check the logs

root@localhost /opt/symmetric-server # tail -f logs/symmetric.log