hi there, I am setting up the environment for Back...
# contributing
n
hi there, I am setting up the environment for Backend from the guidance when I tried to run
ClickHouseUrl=<tcp://localhost:9001> STORAGE=clickhouse build/query-service
to test on local, I got this error:
Copy code
clickhouseReader/reader.go:114	failed to initialize ClickHouse: error connecting to primary db: dial tcp 127.0.0.1:9001: connect: connection refused
do I need to install clickhouse locally?
p
Yes, you can run locally and exposed in port 9001 by following the step 4 in the same docs.
n
I followed the step 4 and stuck at https://github.com/SigNoz/signoz/blob/develop/CONTRIBUTING.md#run-locally when I tried to run
Copy code
ClickHouseUrl=<tcp://localhost:9001> STORAGE=clickhouse go run main.go`
I got the above error
p
@Ngoc Hien Dinh That would mean the clickhouse server didn't start properly from step 4. Clickhouse logs would be helpful.
n
thanks, let me check
1. I checked from my machine, the clickhouse server was on, and the log didn't show any error 2. Running on port 9001 got the same error 3. If I change to 9000, it works(ClickHouseUrl=tcp://localhost:9000 STORAGE=clickhouse go run main.go`) Do I need to turn on the docker?(because the change is in
docker-compose
but don't see the instruction to run docker as prerequisite)
p
You would have to update
docker-compose.yaml
to include
ports
with
9001:9000
:
Copy code
services:
  clickhouse:
    ...
    ports:
    - 9001:9000
Followed by the following:
Copy code
docker-compose -f deploy/docker/clickhouse-setup/docker-compose.yaml up -d
After which:
Copy code
cd pkg/query-service/
DASHBOARDS_PATH=../../deploy/docker/dashboards SIGNOZ_LOCAL_DB_PATH="./signoz.db" ClickHouseUrl=<tcp://localhost:9001> STORAGE=clickhouse go run main.go
Anways, you can go ahead with using
9000
port if that works for you.
Do I need to turn on the docker?(because the change is in
docker-compose
but don't see the instruction to run docker as prerequisite)
Currently, Docker or K8s is a prerequisite to run SigNoz.
n
thank you so much! it works now after I run:
docker-compose -f deploy/docker/clickhouse-setup/docker-compose.yaml up -d
that's what I missed when setting up.