Installing Beacon Agent
The following steps walk you through how to install and configure Beacon Agent, test it locally, and then run the agent to see the results in your Estates page in the EDB Postgres® AI Console.
Before you begin, you need to have the following:
- The access key for a machine user with the
estate ingester
role assigned to it. For more information, see Creating a machine user. - The project ID for the project you want to monitor. You can find this in the URL when you are in the project in the EDB Postgres AI Console.
Enable your system to download packages
You need to enable the system you are planning on running the agent on to download packages from the EDB repositories for EDB Postgres AI.
Locate your EDB subscription token on the the EnterpriseDB repos download page.
Using the retrieved subscription token, set an environmental variables (EDB_SUBSCRIPTION_TOKEN
) to the token's value. Also set an environmental variable for your EDB subscription type (EDB_SUBSCRIPTION_TYPE
) to one of standard
or enterprise
depending on which plan you are signed up to:
Depending on your operating system, run the following command to enable your system to enable package downloading from the EDB repositories:
For RHEL-like or SLES:
For Debian or Ubuntu:
Install the beacon-agent package
You can now install packages from EDB's repositories. Install the beacon-agent
package:
For RHEL-like:
Or if dnf isn't available:
For SLES:
For Debian or Ubuntu:
Configure Beacon Agent
Create a Beacon configuration directory in your home directory:
Next, configure Beacon Agent by setting the access key (the one you obtained while Creating a machine user) and project ID:
Running the beacon-agent setup
command creates a configuration file in the Beacon configuration directory. using those environment variables.
You also need to specify the Beacon configuration directory for storing the configuration file and the name of the configuration file to generate there. The $HOME/.beacon/
file is one of the default locations which beacon_agent
searches for beacon_agent.yaml
when it starts. Using the -file
flag tells the agent setup process to create its configuration file in a specific location.
During the beacon-agent setup
process, an authentication attempt occurs, using the access key and project ID you provided. This authentication is necessary for Beacon Agent to communicate with the Beacon server and to register with the project.
Upon a successful registration, you should see a message indicating that you have authenticated successfully to your EDB Postgres AI project.
Configure database connections
Create DSN/connection strings for each database you want to monitor. These should include the database name, the user, the password, the host, and the port. For example:
"user=postgres password=postgres dbname=postgres host=localhost port=5432"
You can also use a DSN in the format postgres://user:password@host:port/dbname
.
As DSNs can contain sensitive information such as the password, its best practice to create an environmental variable for each database you want to monitor and set each to the a corresponding DSN.
Edit your $HOME/.beacon/beacon_agent.yaml
configuration file and add an entry for each database you want to connect to, including the environmental variable for each database's DSN. Precede the DSN with a $
to indicate that it's an environmental variable. Each database entry should also include tags to help you identify the database in the EDB Postgres AI Console.
Entries under databases
utilize the following format:
Here is an example beacon_agent.yaml
file configured for a database named sales_reporting
:
Test Beacon Agent locally.
For an initial test of the agent, you can get it to send the data that it would normally send to the EDB Enterprise AI control plane to standard output, your terminal session, instead. This allows you to quickly confirm if the agent is successfully able to gather data and what that data looks like.
You can run the agent in standard output mode by modifying the beacon_agent.yaml
file generated previously to have an "agent.beacon_server"
value of "stdout"
. A truncated example of this would be:
Next, run the agent in this mode using the following command:
You should see output similar to the following eventually (it can take around 5 minutes to see the last few lines):
Note
The message in the second to last line of the preceding log confirms that we're viewing the gathered data which is being output to stdout and it hasn't gone to the control plane.
Configure Beacon Agent to send data
The next step is to configure Beacon agent to send data to the EDB Postgres AI control plane.
In the beacon_agent.yaml
file, on the agent.beacon_server
line, replace "stdout"
with "beacon.biganimal.com:443"
:
Run Beacon Agent.
Run the agent using the following command:
The agent will start sending data to the EDB Postgres AI control plane. Follow the logs to monitor the data ingestion process.
Check the EDB Postgres AI Console to see the data from the agent.
After a few minutes, you should see the data from the agent in the EDB Postgres AI Console. Navigate to the Estates page's to see the data from the agent.
Could this page be better? Report a problem or suggest an addition!