ClickHouse Setup
Fivemanage Lite uses ClickHouse as its primary storage engine for structured logs. ClickHouse is an open-source column-oriented database management system that allows generating analytical data reports in real-time. It is chosen for its exceptional performance with high-volume write operations (log ingestion) and fast analytical queries (filtering and searching logs).Running ClickHouse
We recommend using the official Docker imageclickhouse/clickhouse-server.
Docker Command
To run a basic ClickHouse instance:Docker Compose
For a production-ready setup integrated with your stack:Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
CLICKHOUSE_USER | The username for authentication. | default |
CLICKHOUSE_PASSWORD | The password for the user. | password |
CLICKHOUSE_DB | The default database to create on startup. | default |
Connecting Fivemanage Lite
Once ClickHouse is running, configure Fivemanage Lite to connect to it using the following environment variables:Production Recommendations
1. Volume Persistence
Always mount a volume for/var/lib/clickhouse. If you don’t, you will lose all log data when the container restarts.
2. File Limits (ulimits)
ClickHouse requires a high number of open file descriptors.- Docker: Use
--ulimit nofile=262144:262144. - Systemd/Linux: Ensure
/etc/security/limits.confallows high open files for the user running Docker or ClickHouse.
3. Resource Allocation
ClickHouse loves RAM. For a small to medium community, 4GB - 8GB RAM is a good starting point. It is highly efficient, but complex queries over millions of logs will benefit from more memory.4. Security
- Change the default password: Never use
passwordin production. - Network Isolation: Do not expose port
9000(Native) or8123(HTTP) to the public internet. Only Fivemanage Lite needs access to port9000.
Troubleshooting
“Connection refused”- Ensure the container is running:
docker ps - Check logs:
docker logs lite-clickhouse - Verify you are using the correct port (
9000for the Go application, not8123).
- Check your ulimits configuration as described in the Production Recommendations section.
.png?fit=max&auto=format&n=tUtwuHgibAuVylZ9&q=85&s=44653a825fa0664047dae92cd8969b2d)
