Need
We will see in this article how to install 2 Analytics on the same Tomcat server.
Summarized Solution
To install 2 Analytics on the same Tomcat server, we will:
clear Tomcat’s cache
duplicate .war file
specify database definition for each Analytics
Detailed Solution
Clear the cache:
Stop Tomcat.
Delete the "semarchy-xdi-analytics" folder located in the "webapps" directory.
Delete the "Catalina" folder located in the "work" directory.
Restart Tomcat.
Duplicate the .war file and rename it
There will be two analytics sharing the same database and accessible via two different URLs.
In my case:
http://localhost:8080/semarchy-xdi-analytics/semarchy
http://localhost:8080/semarchy-xdi-analytics_2/semarchy
Specify the database for each Analytics
For each Analytics, in the "conf" directory, comment out the resource section of the "context.xml" file and set the correct information to connect to each database.
In the "conf/Catalina/localhost" directory, create two files, each corresponding to an instance of Analytics with the same name as the WAR files (as mentioned above).
In these files, provide the resource corresponding to your database along with the standard Valve.
<?xml version=""1.0"0" encoding=""UTF-8"8"?>
<Context>
<Valve className=""org.apache.catalina.authenticator.FormAuthenticator"FormAuthenticator" landingPage=""/"" />
<Resource name=""jdbc/xdi-analytics-datasource-tomcat"tomcat"
auth="Container""Container" type=""javax.sql.DataSource"DataSource"
driverClassName=""org.postgresql.Driver"Driver"
url=""jdbc:postgresql://localhost:5432/postgres"postgres"
username="analytique2""analytique2"
password="analytique2""analytique2"
maxTotal="100""100"
maxIdle="30""30"
maxWaitMillis="10000""10000"
/>
</Context>
You can now connect to both Analytics: