Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.hostname = "ub1804clickhouse"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1804clickhouse"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.109", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.109", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get -y install language-pack-ja
sed -i.bak -e "s#http://archive.ubuntu.com/ubuntu/#http://ftp.riken.jp/pub/Linux/ubuntu/#g" /etc/apt/sources.list
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
timedatectl set-timezone Asia/Tokyo
apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4
echo "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" >> /etc/apt/sources.list.d/clickhouse.list
apt-get update
apt-get -y install clickhouse-server clickhouse-client
systemctl start clickhouse-server
systemctl enable clickhouse-server
clickhouse-client --query="CREATE TABLE test (test_date Date, test_id UInt16, test_message String) ENGINE = MergeTree(test_date, (test_id), 8192);"
cat << EOF > /tmp/test.csv
2019-03-01,100,hello world!
2019-03-02,200,test data
EOF
cat /tmp/test.csv | clickhouse-client --query="INSERT INTO test FORMAT CSV"
clickhouse-client --query="SELECT * FROM test"
SHELL
end
〇関連情報
・ClickHouseに関する他の情報はこちらを参照してください。
0 件のコメント:
コメントを投稿