diff --git a/backend/cmd/misc/main.go b/backend/cmd/misc/main.go index 97d446cda..84f8d7136 100644 --- a/backend/cmd/misc/main.go +++ b/backend/cmd/misc/main.go @@ -183,27 +183,27 @@ func Run() { defer db.FrontendWriterDB.Close() // clickhouse - // db.ClickHouseWriter, db.ClickHouseReader = db.MustInitDB(&types.DatabaseConfig{ - // Username: cfg.ClickHouse.WriterDatabase.Username, - // Password: cfg.ClickHouse.WriterDatabase.Password, - // Name: cfg.ClickHouse.WriterDatabase.Name, - // Host: cfg.ClickHouse.WriterDatabase.Host, - // Port: cfg.ClickHouse.WriterDatabase.Port, - // MaxOpenConns: cfg.ClickHouse.WriterDatabase.MaxOpenConns, - // SSL: cfg.ClickHouse.WriterDatabase.SSL, - // MaxIdleConns: cfg.ClickHouse.WriterDatabase.MaxIdleConns, - // }, &types.DatabaseConfig{ - // Username: cfg.ClickHouse.ReaderDatabase.Username, - // Password: cfg.ClickHouse.ReaderDatabase.Password, - // Name: cfg.ClickHouse.ReaderDatabase.Name, - // Host: cfg.ClickHouse.ReaderDatabase.Host, - // Port: cfg.ClickHouse.ReaderDatabase.Port, - // MaxOpenConns: cfg.ClickHouse.ReaderDatabase.MaxOpenConns, - // SSL: cfg.ClickHouse.ReaderDatabase.SSL, - // MaxIdleConns: cfg.ClickHouse.ReaderDatabase.MaxIdleConns, - // }, "clickhouse", "clickhouse") - // defer db.ClickHouseReader.Close() - // defer db.ClickHouseWriter.Close() + db.ClickHouseWriter, db.ClickHouseReader = db.MustInitDB(&types.DatabaseConfig{ + Username: cfg.ClickHouse.WriterDatabase.Username, + Password: cfg.ClickHouse.WriterDatabase.Password, + Name: cfg.ClickHouse.WriterDatabase.Name, + Host: cfg.ClickHouse.WriterDatabase.Host, + Port: cfg.ClickHouse.WriterDatabase.Port, + MaxOpenConns: cfg.ClickHouse.WriterDatabase.MaxOpenConns, + SSL: cfg.ClickHouse.WriterDatabase.SSL, + MaxIdleConns: cfg.ClickHouse.WriterDatabase.MaxIdleConns, + }, &types.DatabaseConfig{ + Username: cfg.ClickHouse.ReaderDatabase.Username, + Password: cfg.ClickHouse.ReaderDatabase.Password, + Name: cfg.ClickHouse.ReaderDatabase.Name, + Host: cfg.ClickHouse.ReaderDatabase.Host, + Port: cfg.ClickHouse.ReaderDatabase.Port, + MaxOpenConns: cfg.ClickHouse.ReaderDatabase.MaxOpenConns, + SSL: cfg.ClickHouse.ReaderDatabase.SSL, + MaxIdleConns: cfg.ClickHouse.ReaderDatabase.MaxIdleConns, + }, "clickhouse", "clickhouse") + defer db.ClickHouseReader.Close() + defer db.ClickHouseWriter.Close() // Initialize the persistent redis client rdc := redis.NewClient(&redis.Options{ diff --git a/backend/local_deployment/main.star b/backend/local_deployment/main.star index 85a0a5e3b..187841175 100644 --- a/backend/local_deployment/main.star +++ b/backend/local_deployment/main.star @@ -9,6 +9,7 @@ POSTGRES_DB = "db" ALLOY_PORT_ID = "alloy" ALLOY_DB = "alloy" CLICKHOUSE_PORT_ID = "clickhouse" +CLICKHOUSE_PORT_ID_HTTP = "clickhouse-http" CLICKHOUSE_DB = "clickhouse" POSTGRES_USER = "postgres" POSTGRES_PASSWORD = "pass" @@ -42,7 +43,7 @@ def run(plan, args): image = "clickhouse/clickhouse-server:24.5", ports = { CLICKHOUSE_PORT_ID: PortSpec(9000, application_protocol = "clickhouse"), - "http": PortSpec(8123), + CLICKHOUSE_PORT_ID_HTTP: PortSpec(8123), }, env_vars = { "CLICKHOUSE_DB": CLICKHOUSE_DB, diff --git a/backend/local_deployment/provision-explorer-config.sh b/backend/local_deployment/provision-explorer-config.sh index c81dcccdf..183e0c400 100755 --- a/backend/local_deployment/provision-explorer-config.sh +++ b/backend/local_deployment/provision-explorer-config.sh @@ -14,6 +14,9 @@ echo "Alloy port is $ALLOY_PORT" CLICKHOUSE_PORT=$(kurtosis port print my-testnet clickhouse clickhouse --format number) echo "Clickhouse port is $CLICKHOUSE_PORT" +CLICKHOUSE_PORT_HTTP=$(kurtosis port print my-testnet clickhouse clickhouse-http --format number) +echo "Clickhouse http port is $CLICKHOUSE_PORT_HTTP" + LBT_PORT=$(kurtosis port print my-testnet littlebigtable littlebigtable --format number) echo "Little bigtable port is $LBT_PORT" @@ -23,6 +26,7 @@ EL_PORT=$EL_PORT REDIS_PORT=$REDIS_PORT ALLOY_PORT=$ALLOY_PORT CLICKHOUSE_PORT=$CLICKHOUSE_PORT +CLICKHOUSE_PORT_HTTP=$CLICKHOUSE_PORT_HTTP LBT_PORT=$LBT_PORT EOF