Skip to content

Agent Installation (with Embedded Collector)

github-actions[bot] edited this page Apr 6, 2024 · 32 revisions

Requirements

  • Java 6+

Installation

  1. Download and unzip glowroot-0.14.2-dist.zip
  2. Add -javaagent:path/to/glowroot.jar to your application's JVM args [where are my application server's JVM args?]
  3. Check that the user account that runs the JVM has write access to the glowroot directory [if you are running on Windows and don't know how to check this, it probably means you can skip this step safely]
  4. Start your application
  5. Point your browser to http://localhost:4000

Optional post-installation steps:

  • By default, the Glowroot UI binds to 127.0.0.1 and is only accessible from localhost. If you wish to access the Glowroot UI from remote machines, change the bind address to 0.0.0.0 under Glowroot UI > Configuration > Web. Alternatively, the bind address can be changed by creating (or editing) admin.json (in the same directory as glowroot.jar), e.g.

    {
      "web": {
        "bindAddress": "0.0.0.0"
      }
    }
    
  • The port that the Glowroot UI listens on can be configured under Glowroot UI > Configuration > Web. Alternatively, the port can be changed by creating (or editing) admin.json (in the same directory as glowroot.jar), e.g.

    {
      "web": {
        "port": 12345
      }
    }
    
  • Authentication for the Glowroot UI can be configured under Glowroot UI > Configuration > Users/Roles

Changing up the directory locations?

The location of config files, log files, temp files and data files can be changed by creating a file named glowroot.properties in the agent directory (the same directory that contains the glowroot.jar file):

conf.dir=
log.dir=
tmp.dir=
# only for embedded mode
data.dir=

You could also specify locations on Java command line, next to javaagent

-javaagent:/path/to/glowroot.jar \
-Dglowroot.conf.dir=/path/to/glowroot/confdir \
-Dglowroot.data.dir=/path/to/glowroot/datadir \
-Dglowroot.log.dir=/path/to/glowroot/logdir \
-Dglowroot.tmp.dir=/path/to/glowroot/tmpdir

Running multiple agents on a single box?

If you want to run multiple agents on a single box, you need to create a file named glowroot.properties in the agent directory (the same directory that contains the glowroot.jar file), and add this to the file:

multi.dir=true

And you need to add -Dglowroot.agent.id=... to your JVM args so that each agent can create and use a separate directory under the glowroot directory to store its local configuration and data (the subdirectory name is based on the glowroot.agent.id property). The specified glowroot.agent.id can be any text, it just needs to be unique per agent.

Also, each agent will need a unique Glowroot UI port, which can be configured either under Glowroot UI > Configuration > Web, or directly in admin.json (under the agent's subdirectory) after that file is created on first startup.

config-default.json?

When the agent starts, if there is no config.json file, it will look for a config-default.json file in the following locations:

  • The agent configuration directory (the same directory where the config.json file would be created)
  • The parent of the agent configuration directory if you are running multiple agents on a single box
  • The glowroot installation directory if it is different from the two directories above

If a config-default.json file is found, then that file is used to populate the initial config.json.

If a config-default.json file is not found, then the factory default agent configuration is used to populate the initial config.json.