Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netbek/dw-clickhouse
https://github.com/netbek/dw-clickhouse
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/netbek/dw-clickhouse
- Owner: netbek
- License: agpl-3.0
- Created: 2024-01-02T03:04:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-05T08:00:27.000Z (2 months ago)
- Last Synced: 2024-11-05T09:17:32.843Z (2 months ago)
- Language: Shell
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dw-clickhouse
## Installation
Run the install script:
```shell
./scripts/install.sh
```## Optional extras
### DBeaver
Client for ClickHouse and other databases. To install, run:
```shell
curl https://dbeaver.io/debs/dbeaver.gpg.key | sudo apt-key add -
echo "deb https://dbeaver.io/debs/dbeaver-ce /" | sudo tee /etc/apt/sources.list.d/dbeaver.list
sudo apt update
sudo apt install dbeaver-ce
```See the docs for [creating a connection](https://github.com/dbeaver/dbeaver/wiki/Create-Connection).
### Aliases
Add aliases for frequently used commands to `~/.bash_aliases`:
```shell
# Start ClickHouse
alias ach="cd /path/to/dw-clickhouse && docker compose up -d"# Stop ClickHouse
alias sch="cd /path/to/dw-clickhouse && docker compose down"
```Set `/path/to/` to the location of the repository on your machine. If you prefer to run the containers in the foreground, then omit the `-d` option.
## Uninstall
To delete all the data and Docker images, run:
```shell
./scripts/uninstall.sh
```## Usage
Start the ClickHouse container in detached mode:
```shell
docker compose up -d
```If you prefer to run the containers in the foreground, then omit the `-d` option.
## Database connections
The default settings for the ClickHouse server are:
```yaml
Host: localhost
Port: 29000
Username: analyst
Password: analyst
Database: analytics
```Examples:
| Description | Command |
|---------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Use `clickhouse-client` installed on host machine | `clickhouse-client -h localhost -p 29001 -u analyst --password analyst -d analytics` |
| Use `clickhouse-client` installed in container | `docker compose exec clickhouse clickhouse-client -u analyst --password analyst -d analytics` |
| Use `psql` installed on host machine | `psql -h localhost -p 29002 -U analyst -d analytics` |## Networking
Ports can optionally be exposed. The configuration is loaded from `./.env` during startup.
| Service | Port | Protocol |
|----------------------|-------|-----------------------|
| `clickhouse` | 29000 | HTTP |
| `clickhouse` | 29001 | Native/TCP |
| `clickhouse` | 29002 | Postgres emulation |## License
Copyright (c) 2023 Hein Bekker. Licensed under the GNU Affero General Public License, version 3.