I am deploying symmetricds
on google container engine
, so i have build symmetricds
war
file and create docker
tomcat
image like below :-
FROM tomcat
ENV JAVA_OPTS="-Dcom.sun.management.jmxremote.port=1109 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
ENV CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=1109 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
ADD ./symmetric-ds.war /usr/local/tomcat/webapps/
ADD ./mysql-connector-java-5.1.30.jar /usr/local/tomcat/lib/
COPY ./context.xml /usr/local/tomcat/conf/context.xml
COPY ./server.xml /usr/local/tomcat/conf/server.xml
COPY ./tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml
RUN sh -c 'touch /usr/local/tomcat/webapps/symmetric-ds.war'
VOLUME /usr/local/tomcat/webapps/
EXPOSE 8080 1109
and after that i have push it to repository and i am using kubernetes to deploy it.
my kubernetes
yml
file is below :-
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: symserver
spec:
replicas: 1
template:
metadata:
labels:
app: symserver
spec:
containers:
- name: symserver
image: symserver:v1
ports:
- containerPort: 8080
- containerPort: 1109
---
apiVersion: v1
kind: Service
metadata:
name: symserver
spec:
selector:
app: symserver
type: LoadBalancer
ports:
- port: 8080
- port: 1109
I have two problems for which i am looking for solution :-
As
docker
images are read only whatever properties i have defined insymmetricds.properties
(which will be part of war file and war file be insidetomcat
and i namedtomcat
image assymserver
fordocker
) file are fixed and read only. likesync.url=http://$(hostName):8080/symmtric-ds/sync/$(engineName)
when i deploy it to google cloud i get different ip for pods and service external link. so how to solve this problem ? as i have to set this ip in symmetricds.properties file so my other store node can connect to it. and when i restart the server then it 'symmetricds' will again pickup new ip or same ip again from file.
- How to use
JMX
in case of docker andkubernetes
, i have addedJMX
option in build file but somehow i am not able to connect it usingjconsole
. I have exposed port 1109 to local machine using port forward command.