This example shows how to set up multiple projects_root directories on a single host.
This configuration would be useful when you want to host everything on one machine, but you need to control visibility of projects. Alternatively, you may want to set up one projects_root directory for testing, and another that will be in actual use.
Example configuration
Machine A, projects_root_A: License Server, Database Server, Klocwork Server (default ports)
Machine A, projects_root_B: Database Server, Klocwork Server (alternate ports)
Note: You cannot run multiple License Servers on one host.
Projects_root_A
- Create a projects_root directory. We will call this example projects_root directory projects_root_A.
- Copy your license file to <projects_root_A>/licenses.
- Start the servers for projects_root_A:
-
kwservice --projects-root <projects_root_A> start
- The servers will be started on the default ports: License: 27000, Klocwork: 8080, Database: 3306.
Projects_root_B
- Create a projects_root directory. We will call this example projects_root directory projects_root_B.
- Choose alternate ports for the servers that will not conflict with those of projects_root_A (for example, Klocwork Server: 8074, Database Server: 3315).
- Configure projects_root_B to use the License Server on projects_root_A (where the license file is stored). For example:
-
kwservice --projects-root <projects_root_B> set-service-property license host machineA
- Configure each of the servers for projects_root_B to use the chosen ports. For example:
-
kwservice --projects-root <projects_root_B> set-service-property klocwork port 8090
-
kwservice --projects-root <projects_root_B> set-service-property database port 3315
- Start the servers for projects_root_B:
-
kwservice --projects-root <projects_root_B> start
Test the implementation
- Check that the servers are running for each projects_root:
-
kwservice --projects-root <projects_root_A> check
-
kwservice --projects-root <projects_root_B> check
- Example output for projects_root_B:
- Using projects root: <projects_root_B> Local Host is: machineA [18.1.1.20] Checking License Server [running on machineA:27000] (projects root is projects_root_A) Checking Database Server [running on machineA:3315] (projects root is projects_root_B) Checking Klocwork Server [running on machineA:8074] (projects root is projects_root_B)
- Access http://<klocwork_server_host>:8080/ and http://<klocwork_server_host>:8074/to ensure that you can connect to the Klocwork Servers on port 8080 and port 8074.