Skip to content
Merged
28 changes: 26 additions & 2 deletions docs/src/user-guide/guides-using-presto.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,32 @@ Using Presto with CLP requires:

### Setting up CLP

Follow the [quick-start](./quick-start/index.md) guide to set up CLP and compress your logs. A
sample dataset that works well with Presto is [postgresql].
1. Follow the [quick-start](./quick-start/index.md) guide to download and extract the CLP package,
but don't start the package just yet.
2. Before starting the package, update the package's config as follows:

* Open `etc/clp-config.yml` located within the package.
* Uncomment the `database` section.
* Change `database.host` value to a non-localhost hostname/IP.
* After the change, the `database` section should look something like this:

```yaml
database:
type: "mariadb" # "mariadb" or "mysql"
host: "<new-IP-address>"
port: 3306
name: "clp-db"
```

:::{note}
This change is necessary since the Presto containers run on a Docker network, whereas CLP's
database runs on the host network. So `localhost` refers to two different entities in those
networks. This limitation will be addressed in the future when we unify Presto and CLP's
deployment infrastructure.
:::
Comment on lines +51 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Add a note to ensure the DB listens on a non-loopback interface

Even with a non-localhost host value, connections will fail if MariaDB/MySQL is bound only to 127.0.0.1. A short hint here reduces setup friction.

     :::{note}
     This change is necessary since the Presto containers run on a Docker network, whereas CLP's
     database runs on the host network. So `localhost` refers to two different entities in those
-    networks. This limitation will be addressed in the future when we unify Presto and CLP's
+    networks. Also ensure your database server is listening on a non-loopback interface (e.g.,
+    bind to the host's LAN IP or 0.0.0.0) so containers can connect; adjust your firewall as
+    appropriate for your environment.
+    This limitation will be addressed in the future when we unify Presto and CLP's
     deployment infrastructure.
     :::
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
:::{note}
This change is necessary since the Presto containers run on a Docker network, whereas CLP's
database runs on the host network. So `localhost` refers to two different entities in those
networks. This limitation will be addressed in the future when we unify Presto and CLP's
deployment infrastructure.
:::
:::{note}
This change is necessary since the Presto containers run on a Docker network, whereas CLP's
database runs on the host network. So `localhost` refers to two different entities in those
networks. Also ensure your database server is listening on a non-loopback interface (e.g.,
bind to the host's LAN IP or 0.0.0.0) so containers can connect; adjust your firewall as
appropriate for your environment.
This limitation will be addressed in the future when we unify Presto and CLP's
deployment infrastructure.
:::
🤖 Prompt for AI Agents
In docs/src/user-guide/guides-using-presto.md around lines 51 to 56, add a short
note telling users that even if they set the host to a non-localhost IP,
MariaDB/MySQL must be bound to a non-loopback interface (not 127.0.0.1) for
containers to connect; instruct them to update the DB server configuration (set
bind-address to 0.0.0.0 or the host IP and ensure skip-networking is disabled),
restart the database, and/or adjust firewall rules so the database is reachable
from the Docker network.


3. Continue following the [quick-start](./quick-start/index.md#using-clp) guide to start CLP and
compress your logs. A sample dataset that works well with Presto is [postgresql].

### Setting up Presto

Expand Down