Last active
August 19, 2020 17:11
-
-
Save grigory51/3c8b5fe0ac1e29ef2620630c10d5de6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Установка докера: https://docs.docker.com/engine/install/ubuntu/ | |
# На маке без sudo | |
sudo docker run -d \ | |
--name clickhouse-server \ | |
--ulimit nofile=262144:262144 \ | |
-p 0.0.0.0:8123:8123 -p 0.0.0.0:9000:9000 \ | |
--restart always \ | |
--network redash-docker-compose_default \ | |
-v "$(pwd)/ch-data:/var/lib/clickhouse" \ | |
yandex/clickhouse-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Установка докера: https://docs.docker.com/engine/install/ubuntu/ | |
sudo pip install docker-compose # На маке скорее всего без sudo | |
git clone https://github.com/rongfengliang/redash-docker-compose | |
cd redash-docker-compose | |
# Дописываем в docker-compose.yml в секцию postgres массив volumes, чтобы получилось: | |
# postgres: | |
# image: postgres:9.5.6-alpine | |
# ports: | |
# - "5432:5432" | |
# volumes: | |
# - "./pg-data:/var/lib/postgresql/data" | |
# При рестарте контейнеров это обеспечит то, что данные в редаше не пропадут. | |
# Из секции сервер нужно удалить строку REDASH_COOKIE_SECRET. Иначе очередь не сможет выполнить запрос, будет пытаться расшифровать другим ключом. | |
sudo docker-compose up -d # На маке без sudo | |
sudo docker exec redash-docker-compose_server_1 /app/bin/docker-entrypoint create_db # На маке без sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Создаем таблицу | |
# CREATE TABLE test (id Int, title String) Engine = MergeTree() ORDER BY id | |
curl -d "" -X POST \ | |
'http://localhost:8123?query=CREATE%20TABLE%20test%20%28id%20Int,%20title%20String%29%20Engine%20=%20MergeTree%28%29%20ORDER%20BY%20id' | |
# Заливаем CSV | |
# Grigorys-MacBook-Air:redash-docker-compose grigoryozhegov$ cat data.csv | |
# id,title | |
# 1,"hello" | |
# 2,"its me" | |
cat data.csv | curl 'http://localhost:8123/?query=INSERT%20INTO%20test%20FORMAT%20CSVWithNames' --data-binary @- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment