Comments (6)
Hi All,
Today I deployed self-hosted Plausible in the docker swarm environment successfully behind Caddy Server
. I used the external Postgres database because I have a Postgres database container already running in the docker swarm.
You have to create plausible_events_db in the clickhouse server
container for the first time.
Run docker ps
to find out the container ID of the clickhouse server
Run docker exec -it <clickhousecontainerid> clickhouse-client
to log into clickhouse server
Then run create database plausible_events_db;
to create plausible events database. In this case plausible_events_db
Exit from the container by entering exit
Please find docker-compose stack below
version: "3.7"
services:
mail:
image: bytemark/smtp
networks:
- caddy
deploy:
placement:
constraints: [node.role == worker]
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
plausible_events_db:
image: yandex/clickhouse-server:latest
volumes:
- /mnt/clickhouse:/var/lib/clickhouse
- /mnt/config/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- /mnt/config/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
networks:
- caddy
deploy:
placement:
constraints: [node.role == worker]
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
plausible:
image: plausible/analytics:latest
command: sh -c "sleep 10 && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
depends_on:
- postgres
- plausible_events_db
- mail
environment:
- ADMIN_USER_NAME=admin
- [email protected]
- ADMIN_USER_PWD=password
- DATABASE_URL=postgres://username:password@postgresservicename:5432/plausibledatabsename
- DATABASE_NAME=plausibledatabsename
- CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/clickhousedatabsename
- CLICKHOUSE_FLUSH_INTERVAL_MS=5000
- CLICKHOUSE_MAX_BUFFER_SIZE=10000
- BASE_URL=https://plausible.example.com
- PORT=8000
- LISTEN_IP=0.0.0.0
- SECRET_KEY_BASE=generate one using 'openssl rand -hex 64'
- [email protected]
- SMTP_HOST_ADDR=smtp host name
- SMTP_HOST_PORT=smtp port
- SMTP_USER_NAME=smtp user name
- SMTP_USER_PWD=smtp password
- SMTP_HOST_SSL_ENABLED=false
- SMTP_RETRIES=2
networks:
- caddy
ports:
- "8000:8000"
deploy:
placement:
constraints: [node.role == manager]
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
volumes:
clickhouse:
driver: "local"
config:
driver: "local"
networks:
caddy:
external: true
from community-edition.
iam ubuntu 22 and docker swarm used
from community-edition.
I encountered the same error today. @productdevbook , did you get the self-hosted solution to work in some other way?
from community-edition.
@rajaseg please share /mnt/
all docs
from community-edition.
@rajaseg please share
/mnt/
all docs
@productdevbook, I deployed GlusterFS as a replicated volume in my docker swarm environment for data availability throughout the cluster.
That's why I mounted clickhouse server volume and configuration files to /mnt
directory
Please find the configuration files below.
/mnt/config/clickhouse-config.xml
<yandex>
<logger>
<level>warning</level>
<console>true</console>
</logger>
<!-- Stop all the unnecessary logging -->
<query_thread_log remove="remove"/>
<query_log remove="remove"/>
<text_log remove="remove"/>
<trace_log remove="remove"/>
<metric_log remove="remove"/>
<asynchronous_metric_log remove="remove"/>
</yandex>
/mnt/config/clickhouse-user-config.xml
<yandex>
<profiles>
<default>
<log_queries>0</log_queries>
<log_query_threads>0</log_query_threads>
</default>
</profiles>
</yandex>
Link for the configuration files below.
https://github.com/plausible/hosting/tree/master/clickhouse
from community-edition.
Closing as docker swarm setups are not officially supported.
from community-edition.
Related Issues (20)
- document TOTP_VAULT_KEY length requirement HOT 1
- add Bamboo.Mua + gmail app password guide HOT 1
- document extra config
- Web page is not accessible after deploy containers using docker composer HOT 1
- Is it possible to use GeoIP databases with additional information? HOT 4
- document docker compose override files
- Arm64 Images support HOT 2
- Upgrade from 1.5 to 2.1 RC resulted in data loss HOT 2
- CH volume for logs
- Feature Request: Expose custom JS API to detect unique user/visitor HOT 1
- Clickhouse version 23.3 no longer supported HOT 3
- document DATA_DIR HOT 1
- [error] <PID> running PlausibleWeb.Endpoint (connection stream id ) terminated | (Protocol.UndefinedError) protocol Jason.Encoder not implemented for HOT 5
- Raspberry Pi + Cloudflare tunnel issue while docker compose HOT 5
- Preview doesn't load HOT 2
- Plausible log in weekly/monthly email reports points to a HTTP 404 link HOT 3
- Caddy-gen doesn't support ARM
- External Postgres DB connection (with ssl, digitalocean) does not work HOT 7
- enable query_log in ClickHouse HOT 1
- Database plausible_events_db does not exist HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from community-edition.