Overview
The goal for this process is to split complex reporting queries from the production database.
Prerequisite
- Your qTest Manager and qTest Sessions database are on the same Postgres database server.
- This article assumes you have the knowledge to create a postgres read-replica server.
Note: These instructions are verified on qtestctl 6.3 (9.6.1).
Stop Insights
- Linux (non-Docker)- Access the current directory "qtestctl" where you've installed your latest version of Insights.
systemctl stop qtest
- Windows
C:\[path_to_qtestctl]>net stop qtest
Modify qtestctl/insights/build.gradle
Note: Remember to fill your replicated DB information into the placeholders.
-
Find keyword: qtestread.url=${qtestJdbcUrlWithoutCredential} (Line 239, in qTest version 9.6.1.)
-
Replace with qtestread.url=jdbc://postgresql://<YOUR READ REPLICA HOST>/${config['insights.postgres.db']}
qtestctl/insights/build.gradle 237 #--------INFO QTEST DATABASE READ -----------
238 qtestread.poolName=Qtest Read DB Pool
239 qtestread.url=${qtestJdbcUrlWithoutCredential} - Find keyword: sessionread.url=${sessionJdbcUrlWithoutCredential} (Line 253, in qTest version 9.6.1.)
- Replace with sessionread.url=jdbc://postgresql://<YOUR READ REPLICA HOST>/${config['sessions.postgres.db']}
qtestctl/insights/build.gradle 251 #--------INFO SESSION DATABASE READ ---------
252 sessionread.poolName=Session Read DB Pool
253 sessionread.url=${sessionJdbcUrlWithoutCredential} - Find keyword: PostgreSQLServer="${config['insights.postgres.host']}" (Line 458, in qTest version 9.6.1.)
- Replace with PostgreSQLServer="<YOUR READ REPLICA HOST>"
qtestctl/insights/build.gradle 455 CommandTimeOut="600"
456 PostgreSQLConnectionString="${logiConnectionStringqTest}"
457 ID="qTestMySQL"
458 PostgreSQLServer="${config['insights.postgres.host']} - Find keyword: PostgreSQLServer="${config['sessions.postgres.host']}" (Line 480, in qTest version 9.6.1.)
- Replace with PostgreSQLServer="<YOUR READ REPLICA HOST>"
qtestctl/insights/build.gradle 477 CommandTimeOut="600"
478 ID="sessionDB"
479 PostgreSQLConnectionString="${logiConnectionStringSession}"
480 PostgreSQLServer="${config['sessions.postgres.host']}"
Restart qTest Service and Verify
- Linux (non-Docker)
$ systemctl start qtest
- Windows
C:\[path_to_qtestctl]>net start qtest
Access Insights from the 9-box in qTest Manager and verify connectivity.