-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the setup of clickhouse into ansible
- Loading branch information
Showing
3 changed files
with
66 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,11 @@ | ||
#!/bin/bash | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo hostnamectl set-hostname --static ${hostname} | ||
|
||
# Install datadog agent | ||
DD_API_KEY=${datadog_api_key} DD_SITE="datadoghq.eu" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)" | ||
|
||
# Install clickhouse following the instructions at: https://clickhouse.com/docs/en/install | ||
sudo apt-get install -y apt-transport-https ca-certificates dirmngr | ||
GNUPGHOME=$(mktemp -d) | ||
sudo GNUPGHOME="$GNUPGHOME" gpg --no-default-keyring --keyring /usr/share/keyrings/clickhouse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8919F6BD2B48D754 | ||
sudo rm -rf "$GNUPGHOME" | ||
sudo chmod +r /usr/share/keyrings/clickhouse-keyring.gpg | ||
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee \ | ||
/etc/apt/sources.list.d/clickhouse.list | ||
sudo apt-get update | ||
sudo apt install -y clickhouse-server clickhouse-client | ||
sudo systemctl start clickhouse-server | ||
sudo systemctl enable clickhouse-server | ||
|
||
# Configure the ebs data volume | ||
sudo service clickhouse-server stop | ||
sudo mkfs.ext4 -q -F ${device_name} | ||
sudo mkdir -p /var/lib/clickhouse | ||
sudo mount ${device_name} /var/lib/clickhouse | ||
echo "${device_name} /var/lib/clickhouse ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab | ||
sudo chown -R clickhouse:clickhouse /var/lib/clickhouse | ||
sudo service clickhouse-server start | ||
sudo chown -R clickhouse:clickhouse /var/lib/clickhouse |