There is a running ClickHouse container
clickhouse-server:
image: yandex/clickhouse-server
container_name: clickhouse-server
ports:
- '8123:8123'
- '9000:9000'
volumes:
- ./db:/var/lib/clickhouse
ulimits:
nofile: 262144
There are configured connection parameters in .env
CLICKHOUSE_HOST=clickhouse-server
CLICKHOUSE_PORT=8123
CLICKHOUSE_DATABASE=memorial_analitucs
CLICKHOUSE_USERNAME=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_TIMEOUT_CONNECT=5
CLICKHOUSE_TIMEOUT_QUERY=5
When performing the migration, it returns the following error
2024_04_18_182025_create_analytics_table ............................................................................................ 3,710ms FAIL
ClickHouseDBExceptionQueryException
Could not resolve host: clickhouse-server
When clicking on the link http://localhost:8123 outputs "OK". Can you tell me what the problem might be?
2
Answers
Adding a network parameter worked in container.
config/database.php open add
under "connections" array put it and try again.