Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for installing nginx-agent from repository #309

Merged
merged 18 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ NGINX Agent allows a gRPC connected control system to register a listener for a

| Event | Description |
| -------------------------------- | -------------------------------------------- |
| AGENT_START_MESSAGE | NGINX Agent process started |
| AGENT_STOP_MESSAGE | NGINX Agent process stopped |
| AGENT_START_MESSAGE | NGINX Agent process started |
| AGENT_STOP_MESSAGE | NGINX Agent process stopped |
| NGINX_FOUND_MESSAGE | NGINX master process detected on system |
| NGINX_STOP_MESSAGE | NGINX master process stopped |
| NGINX_RELOAD_SUCCESS_MESSAGE | NGINX master process reloaded successfully |
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Changelog"
draft: false
description: "NGINX Agent updates changelog."
weight: 700
weight: 900
toc: true
tags: [ "docs" ]
docs: "DOCS-1093"
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Contributing and Support"
draft: false
description: "Learn about the NGINX Agent community."
weight: 600
weight: 800
toc: true
tags: [ "docs" ]
docs: "DOCS-1087"
Expand Down
6 changes: 3 additions & 3 deletions hugo/content/dev-environment-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Development Environment Setup"
draft: false
description: "Learn how to setup a Development Environment for NGINX Agent."
weight: 400
weight: 700
toc: true
tags: [ "docs" ]
docs: "DOCS-1088"
Expand All @@ -16,7 +16,7 @@ While most Linux or FreeBSD operating systems can be used to contribute to the N

## Install NGINX

Follow the steps in the [Installation]({{< relref "/installation.md" >}}) section to download, install, and run NGINX and NGINX Agent.
Follow the steps in the [Installation]({{< relref "/installation-github.md" >}}) section to download, install, and run NGINX and NGINX Agent.

## Clone the NGINX Agent Repository

Expand Down Expand Up @@ -56,7 +56,7 @@ make install-tools deps

Run the following commands to build and run NGINX Agent:

```
```bash
make build
sudo make run
```
41 changes: 34 additions & 7 deletions hugo/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Getting Started"
draft: false
description: "Learn how to configure and run NGINX Agent."
weight: 300
weight: 600
toc: true
tags: [ "docs" ]
docs: "DOCS-1089"
Expand All @@ -14,7 +14,7 @@ Follow these steps to configure and run NGINX Agent and a mock interface ("contr

## Install NGINX

Follow the steps in the [Installation]({{< relref "/installation.md" >}}) section to download, install, and run NGINX.
Follow the steps in the [Installation]({{< relref "/installation-github.md" >}}) section to download, install, and run NGINX.

## Clone the NGINX Agent Repository

Expand All @@ -28,7 +28,7 @@ NGINX Agent and the Mock Control Plane are written in Go. Go 1.19 or higher is r

Start the mock control plane by running the following command from the `agent` source code root directory:

```bash
```shell
go run sdk/examples/server.go

# Command Output
Expand All @@ -37,13 +37,17 @@ INFO[0000] grpc listening at 54789 # grpc control plane port which NGINX Agent w
```

## NGINX Agent Settings

If it doesn't already exist, create the `/etc/nginx-agent/` directory and copy the `nginx-agent.conf` file into it from the project root directory.
```

```shell
sudo mkdir /etc/nginx-agent
sudo cp <project_root_directory>/nginx-agent.conf /etc/nginx-agent/
```

Create the `agent-dynamic.conf` file in the `/var/lib/nginx-agent/` directory, which is required for NGINX Agent to run.
```

```shell
sudo touch /var/lib/nginx-agent/agent-dynamic.conf
```

Expand All @@ -65,6 +69,7 @@ tls:
For more information, see [Agent Protocol Definitions and Documentation](https://github.com/nginx/agent/tree/main/docs/proto/README.md)

### Enable the REST interface

The NGINX Agent REST interface can be exposed by validating the following lines in the `/etc/nginx-agent/nginx-agent.conf` file are present:

```yaml
Expand All @@ -79,15 +84,17 @@ api:
The mock control plane can use either gRPC or REST protocols to communicate with NGINX Agent.

## Launch Swagger UI

Swagger UI requires goswagger be installed. See [instructions for installing goswagger](https://goswagger.io/install.html) for additional help.

To launch the Swagger UI for the REST interface run the following command

```bash
```shell
make launch-swagger-ui
```

## Extensions

An extension is a piece of code, not critical to the main functionality that the NGINX agent is responsible for. This generally falls outside the remit of managing NGINX Configuration and reporting NGINX metrics.

To enable an extension, it must be added to the extensions list in the `/etc/nginx-agent/nginx-agent.conf`.
Expand All @@ -104,7 +111,7 @@ If already running, restart NGINX Agent to apply the new configuration. Alternat

Open another terminal window and start the NGINX Agent. Issue the following command from the `agent` source code root directory.

```bash
```shell
sudo make run

# Command Output snippet
Expand Down Expand Up @@ -139,3 +146,23 @@ Open a web browser to view the mock control plane at [http://localhost:54790](ht
- **metrics** - shows a buffer of metrics sent to the management plane (similar to what will be sent back in the REST API)

For more NGINX Agent use cases, refer to the [NGINX Agent SDK examples](https://github.com/nginx/agent/tree/main/sdk/examples).

## Start and Enable Start on Boot

To start the NGINX Agent on `systemd` systems, run the following command:

```shell
sudo systemctl start nginx-agent
```

To enable the NGINX Agent to start on boot, run the following command:

```shell
sudo systemctl enable nginx-agent
```

## Logs

NGINX Agent uses formatted log files to collect metrics. Expanding log formats and instance counts will also increase the size of the NGINX Agent log files. We recommend adding a separate partition for `/var/log/nginx-agent`.

{{< important >}}Without log rotation or storage on a separate partition, log files could use up all the free drive space and cause your system to become unresponsive to certain services.{{< /important >}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Installation"
title: "Installation from GitHub Release"
draft: false
description: "Learn how to install NGINX Agent."
description: "Learn how to install NGINX Agent from a GitHub Release."
weight: 200
toc: true
tags: [ "docs" ]
Expand All @@ -14,58 +14,38 @@ doctypes: ["task"]

NGINX Agent interfaces directly with an NGINX server process installed on the same system. If you don't have it already, follow these steps to install [NGINX Open Source](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/) or [NGINX Plus](https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-plus/). Once installed, ensure the NGINX instance is running.

## Install Agent from Package Files
## Install NGINX Agent from Package Files

To install NGINX Agent on your system, go to [Releases](https://github.com/nginx/agent/releases) and download the latest package supported by your OS distribution and CPU architecture.
To install NGINX Agent on your system, go to [GitHub Releases](https://github.com/nginx/agent/releases) and download the latest package supported by your OS distribution and CPU architecture.

Use your system's package manager to install the package. Some examples:

- Debian, Ubuntu, and other distributions using the `dpkg` package manager.

```
```shell
sudo dpkg -i nginx-agent-<agent-version>.deb
```

- RHEL, CentOS RHEL, Amazon Linux, Oracle Linux, and other distributions using the `yum` package manager

```
```shell
sudo yum localinstall nginx-agent-<agent-version>.rpm
```

- RHEL and other distributions using the `rpm` package manager

```
```shell
sudo rpm -i nginx-agent-<agent-version>.rpm
```

- Alpine Linux

```
```shell
sudo apk add nginx-agent-<agent-version>.apk
```

- FreeBSD

```
```shell
sudo pkg add nginx-agent-<agent-version>.pkg
```

## Start and Enable Start on Boot

To start the NGINX Agent on `systemd` systems, run the following command:

```
sudo systemctl start nginx-agent
```

To enable the NGINX Agent to start on boot, run the following command:

```
sudo systemctl enable nginx-agent
```

## Logs

NGINX Agent uses formatted log files to collect metrics. Expanding log formats and instance counts will also increase the size of the NGINX Agent log files. We recommend adding a separate partition for `/var/log/nginx-agent`.

{{< important >}}Without log rotation or storage on a separate partition, log files could use up all the free drive space and cause your system to become unresponsive to certain services.{{< /important >}}
Loading