Skip to content

Commit

Permalink
added clickhouse http port
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Sep 27, 2024
1 parent 2b7ca3c commit 3c32d70
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
42 changes: 21 additions & 21 deletions backend/cmd/misc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
3 changes: 2 additions & 1 deletion backend/local_deployment/main.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions backend/local_deployment/provision-explorer-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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

Expand Down

0 comments on commit 3c32d70

Please sign in to comment.