Externalize Mapstore Configuration file - JVM options help?

81 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

rususo...@gmail.com

unread,
Jan 1, 2022, 12:42:38 PM1/1/22
to mapstore-users
Hi all,

I am doing a fresh install of Mapstore on a Linux Mint + Apache Tomcat 9 installation. Apache Tomcat is installed as per the tutorial here: https://www.digitalocean.com/community/tutorials/install-tomcat-9-ubuntu-1804

So everything tomcat is in the /opt/tomcat/ installation, owned by the tomcat group
I also provisioned a mapstore config folder at /opt/mapstore-conf for the external overwrites.

I have tried looking at the documentation, and I see that I have to specify to Tomcat the -Ddatadir.location JVM system property, as per the instructions here:

I tried adding to my
/etc/systemd/system/tomcat.service service definition file the following:
Environment='JAVA_OPTS=-Ddatadir.location=/opt/mapstore-conf/'
Is this the correct way of adding the JVM system property?
If it is, however any changes I try to make in the localConfig.json in the external file fails to register with the Mapstore Application. Is

I see that the java process is initializing with the above parameter, :
$ ps -eaf|grep -i java
tomcat 10237 1 5 19:07 ? 00:00:34 /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Ddatadir.location=/opt/mapstore-conf/ -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xms1024M -Xmx2048M -server -XX:+UseParallelGC -Dignore.endorsed.dirs= -classpath /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start sorin 10723 2602 0 19:17 pts/0 00:00:00 grep --color=auto -i java

Am I in the right direction with my configurations? Anyone?

Michael Steigemann

unread,
Jan 3, 2022, 9:17:44 AM1/3/22
to mapstor...@googlegroups.com
Hello!

I also tried hard to externalize the mapstore configuration on Ubuntu but unfortunately did not succeed. So I am running mapstore with the configuration inside the application. I would also be very interested to know if anyone had success in externalizing the mapstore configuration?

Thanks and all the best,
Michael



--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/446dea1d-66e8-4c97-b65a-44951c0b2437n%40googlegroups.com.

Lorenzo Natali

unread,
Jan 7, 2022, 4:40:24 AM1/7/22
to mapstore-users
Hi,
The configuration seems correct. 
here some more questions and checks to do: 
- What version of MapStore did you installed. Notice that the support for MapStore main product has been introduced from version 2021.02.00, so you make sure to have at least this version. (or better 2021.02.01, released in december)
- The user that runs tomcat has read permissions on the data directory ? (it should have also write permissions, in case of extensions installation)
- Other files are working (for instance database configuration) ?
- did you placed the custom localConfig.json file in configs/ sub-directory of data directory (following the structure indicated in the documentation) ? 


Please Let us know.
Message has been deleted

Lorenzo Natali

unread,
Feb 8, 2022, 12:22:59 PM2/8/22
to mapstor...@googlegroups.com
Hi,
Please let us know if the permission change works for you. 

>One more question, if we externalize the config files, do we also manually have to remove the config files in the application folder:
> e.g. /opt/tomcat/webapps/mapstore_v2021.02.01/configs/localConfig.json?
No, it is not necessary. The configurations in the datadir have a higher priority than the internal ones.  It is a desired behavior to allow installation to use the war without modification.
Note that you can add to the <datadir>/configs, as an alternative of the full "localConfig.json", a "localConfig.json.patch" that contains only the changes to apply to the original file. See this
This is useful to keep only changes and not a full copy, to simplify future updates.

Note: 
Please use "reply to everyone" so anyone can see that you solved the problem

Il giorno ven 4 feb 2022 alle ore 10:19 rususo...@gmail.com <rususo...@gmail.com> ha scritto:
Hi Lorenzo,

We did a fallback on modifying the configuration files inside the application, for the moment. We will try during the weekend to redo the above configuration and try your checks.
Just to answer your questions: 
- we are using Mapstore v2021.02.01 so we should be good about the version of the application
- here is the contents of the mapstore-conf folder:
image_2022-02-03_100446.png
- i believe that it is as you say a permissions issue; I will chown -R to tomcat:tomcat the entire contents, redo the JVM options, and restart everything. 

One more question, if we externalize the config files, do we also manually have to remove the config files in the application folder:
e.g. /opt/tomcat/webapps/mapstore_v2021.02.01/configs/localConfig.json?

Sorin R.
Reply all
Reply to author
Forward
0 new messages