gradle-war-deployer for karuta embed deployed app on tomcat, like the tomcat-manager, psi-probe
For installation and migration details please read the documentation on the wiki
Following are only additional informations for the project !
run with java 11 minimum
- customize tomcat path install
cp build.properties.sample build.properties
and editbuild.properties
- run
./gradlew tomcatInstall
to- unzip tomcat from offical sources
- deploy custom conf from
etc/tomcat/
- this task call thetomcatConfig
task that could be used for deploying only a new tomcat conf on an existing tomcat - copy karuta backend and filserver config from
etc/karuta/
into$PROJECT_HOME
path.- the default path use
$CATALINA_BASE
if set, orserver.base
property frombuild.properties
- this variable will be overriden by
$KARUTA_HOME
if set - if no
$KARUTA_HOME
is set, this can be overriden byproject.home
property frombuild.properties
or passed in argument of all gradle commands - WARNING:
etc/karuta/
path is defined fromappName
property intogradle.properties
, don't modify it !
- the default path use
- run
./gradlew tomcatDeploy --refresh-dependencies
will deploy on tomcat webapps directorypsi-probe
for tomcat overview and managementkaruta-backend
karuta-fileserver
karuta-frontend
(onkaruta
)
- run
./gradlew deployKarutaConfig
to deploy into tomcat webapps thekaruta-config
webapp frometc/karuta-config/
- customize your jvm env with a such configuration example to adapt:
** You should set jvm env variables **
You can set the env conf into the ${karutaDeployerPath}/etc/tomcat/bin/setenv.sh
or in your script runing the tomcat start command.
NOTE 1: You can have a git repository to manage karuta-backend_config
and karuta-fileserver_config
, or have a NFS shared directory for all *_config + fileserver_data on which you apply snapshot save.
NOTE 2: You can set KARUTA_REPORT_FOLDER
environnement variable to customize the folder where log reports will be produced.
The database should be created first with required grants for the server where is deployed Karuta. For that you can use the sql script etc/database/karuta-account.sql as example.
NB: The database should be tuned with this conf:
- create custom file for mariadb 10.5 on debian 11 like
/etc/mysql/mariadb.conf.d/51-custom.cnf
- edit and add the content
[mariadb]
tmp_memory_table_size=2G
max_heap_table_size=2G
Following provide all commands that you should run from the project (it's an example on what can be done):
mysql -h${sql.server.host} -u ${user} -p ${password} ${database} < etc/database/karuta-backend-func.sql
mysql -h${sql.server.host} -u ${user} -p ${password} ${database} < etc/database/karuta-backend.sql
mysql -h${sql.server.host} -u ${user} -p ${password} ${database} < etc/database/report-helper.sql
Most important file to watch on is etc/tomcat/server.xml
:
- the connector configured by default is for proxy HTTP and not for AJP
- you can set the
<resource></resource>
to use a secured, managed, monitored from jmx JDBC pool. The default conf is nearly a good one for production - accesslog valve is configured for a HAproxy frontend
You should set a proxy http configurations on a frontal server
./gradlew tomcatStart
Connect to the Karuta app and import the ZIP files that are into etc/model/
in the order of file names (a number provide the order to import).
Before any upgrade, consider to make:
- a dump of the database
- a backup of the fileserver data (path from $KARUTA_HOME/karuta-fileserver_data/)
For most case you should only do some git command updates to upgrade the karuta-deployer which permit to upgrade all karuta's apps. But see all docs indicated, or watch around commit change on this project for more actions during upgrade process.
# save local change and sync remote repositories
git stash && git fetch --all
# Checkout the version of your choice
git checkout -b v1.0.8 v1.0.8
# re-apply local changes
git stash --apply
# watch all files properties for changes (_init.js, configKaruta.properties)
./gradlew tomcatInstall
./gradlew tomcatDeploy
./gradlew deployKarutaConfig
-
When migrating from kapc1.2 or 1.3.x, apply :
mysql -h${sql.server.host} -u ${user} -p ${password} ${database} -e "DROP TABLE vector_table;"
mysql -h${sql.server.host} -u ${user} -p ${password} ${database} < etc/database/report-helper.sql
-
When migrating from kapc 1.3, apply also such change on database:make dump of database, applysed -e 's/^) ENGINE=MyISAM/) ENGINE=InnoDB/'
on file and import dump - warning fonctions (routines) should be dumped too, or you will need to importetc/database/karuta-backend-func.sql