Clickhouse: Setting up ClickHouse on MacOS not working as per documentation

Created on 17 Apr 2018  Â·  11Comments  Â·  Source: ClickHouse/ClickHouse

I tried to set up ClickHouse on my mac, and followed the steps listed here - https://clickhouse.yandex/docs/en/development/build_osx/, however, it did not work for me.
I had to use clang and some changes in code in order to set it up.
Is this documentation updated, if not, what are the steps to be followed to set it up on mac.

build comp-darwin st-need-info

Most helpful comment

Last stable build for homebrew
https://github.com/arduanov/homebrew-clickhouse

All 11 comments

For dev env, Docker is best option.

Last stable build for homebrew
https://github.com/arduanov/homebrew-clickhouse

@arduanov Is there the way to install client only?

Now you can build only client :

cmake .. -DENABLE_CLICKHOUSE_ALL=0 -DENABLE_CLICKHOUSE_CLIENT=1 -DCMAKE_CXX_COMPILER=`which g++-7` -DCMAKE_C_COMPILER=`which gcc-7`
make -j clickhouse-client

Now you can build only client :

cmake .. -DENABLE_CLICKHOUSE_ALL=0 -DENABLE_CLICKHOUSE_CLIENT=1 -DCMAKE_CXX_COMPILER=`which g++-7` -DCMAKE_C_COMPILER=`which gcc-7`
make -j clickhouse-client

Doesn't work for now.

How exactly it doesn't work?

You have to replace make with ninja.

Relates #235

Hi! This was a big problem for me, but I used Docker and now it's working fine. Here are a few steps that might help:

  1. Install Docker Desktop on your Mac.
  2. Create a Clickhouse container, but remember to expose both ports:
    docker run -d --name clickhouse-local -p 8123:8123 -p 9000:9000 --ulimit nofile=262144:262144 yandex/clickhouse-server
  3. You can access the container with sudo docker exec -it clickhouse-local bash
  4. Inside the container you can access the Clickhouse client by doing clickhouse-client
  5. You can create your first database there with CREATE DATABASE myfirstdatabase
  6. I recommend DBeaver to set up a connection with the database, remember the structure for the JDBC driver will be: jdbc:clickhouse://<USER>:<PASSWORD>@localhost:8123/<DATABASE>. Remember that the 8123 port is exposed for the HTTP interface, but if you want to connect to the native client (maybe an ingestion via script like I do) you need to use port 9000.

I hope this helps!

brew tap arduanov/clickhouse
brew install gcc@8
brew install --cc=gcc-8 clickhouse

You many encounter dependency errors during the above install. If a dependency fails to install, identify that dependency in the error and:

  1. brew install [dependency] (without the --cc flag).
  2. brew install --cc=gcc-8 clickhouse (again)

You may have to do the above repeatedly for each error.

Let's continue in #6459

Was this page helpful?
0 / 5 - 0 ratings