Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slach/clickhouse-zetcd
Test stand for creating Clickhouse test cluster via docker and zetcd
https://github.com/slach/clickhouse-zetcd
Last synced: 3 days ago
JSON representation
Test stand for creating Clickhouse test cluster via docker and zetcd
- Host: GitHub
- URL: https://github.com/slach/clickhouse-zetcd
- Owner: Slach
- License: gpl-2.0
- Created: 2017-05-09T15:32:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-06T12:49:44.000Z (over 5 years ago)
- Last Synced: 2024-11-16T23:39:45.554Z (about 2 months ago)
- Size: 21.5 KB
- Stars: 19
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Installation
------------
- Install Virualbox https://virtualbox.org and Vagrant http://vagrantup.com
- run provision script
```
vagrant up clickhouse_zetcd --provision
```- connect to virtualbox and run check scripts
```
vagrant ssh clickhouse_zetcd
sudo bash
cd /vagrant
docker-compose up -d
docker-compose run clickhouse-client.local -h clickhouse-ru-1.local --echo -q "CREATE DATABASE IF NOT EXISTS zetcd_test"
docker-compose run clickhouse-client.local -h clickhouse-ru-2.local --echo -q "CREATE DATABASE IF NOT EXISTS zetcd_test"
docker-compose run clickhouse-client.local -h clickhouse-ru-1.local --echo -q "CREATE TABLE IF NOT EXISTS zetcd_test.test_replicated (timestamp UInt32, date MATERIALIZED toDate(timestamp), trackerId String, userId String ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/hits_replicated', '{replica}', date, cityHash64( userId), (trackerId, date, cityHash64(userId), timestamp), 8192);"
docker-compose run clickhouse-client.local -h clickhouse-ru-2.local --echo -q "CREATE TABLE IF NOT EXISTS zetcd_test.test_replicated (timestamp UInt32, date MATERIALIZED toDate(timestamp), trackerId String, userId String ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/hits_replicated', '{replica}', date, cityHash64( userId), (trackerId, date, cityHash64(userId), timestamp), 8192);"
docker-compose run clickhouse-client.local -h clickhouse-ru-1.local --echo -q "INSERT INTO zetcd_test.test_replicated (timestamp, trackerId, userId ) VALUES (1, 'test1','test1')"
docker-compose run clickhouse-client.local -h clickhouse-ru-2.local --echo -q "INSERT INTO zetcd_test.test_replicated (timestamp, trackerId, userId ) VALUES (1, 'test2','test2')"
docker-compose run clickhouse-client.local -h clickhouse-ru-1.local --echo -q "SELECT * FROM zetcd_test.test_replicated"
docker-compose run clickhouse-client.local -h clickhouse-ru-2.local --echo -q "SELECT * FROM zetcd_test.test_replicated"# search something like zetcd_test.test_replicated (StorageReplicatedMergeTree, RestartingThread): Activating replica.
docker-compose logs clickhouse-ru-1.local | less
docker-compose logs zktraffic
```