https://signoz.io logo
#contributing
Title
# contributing
n

Ngoc Hien Dinh

10/29/2022, 9:18 AM
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

Prashant Shahi

10/30/2022, 2:06 AM
Yes, you can run locally and exposed in port 9001 by following the step 4 in the same docs.
n

Ngoc Hien Dinh

10/30/2022, 7:39 AM
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

Prashant Shahi

11/04/2022, 2:59 AM
@Ngoc Hien Dinh That would mean the clickhouse server didn't start properly from step 4. Clickhouse logs would be helpful.
n

Ngoc Hien Dinh

11/04/2022, 4:57 AM
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

Prashant Shahi

11/14/2022, 10:45 AM
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

Ngoc Hien Dinh

11/14/2022, 3:43 PM
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.
2 Views