Last active
February 5, 2017 04:04
-
-
Save xiaoshuai/c20269ee49b609194dc6e6ee9314862c to your computer and use it in GitHub Desktop.
vagrant-grafana-influxdb
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.require_version ">= 1.9.1" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# 设置常量 | |
if ENV['DEV_VB_MEM'] | |
memory = ENV["DEV_VB_MEM"] | |
else | |
memory = 1024 | |
end | |
config.vm.box = "xenial64" | |
config.vm.synced_folder "../local-apt-repo", "/local-apt-repo" | |
config.vm.network "forwarded_port", guest: 8083, host: 8083 | |
config.vm.network "forwarded_port", guest: 8086, host: 8086 | |
config.vm.network "forwarded_port", guest: 3000, host: 3000 | |
config.vm.provision :shell, path: "bin/bootstrap.sh" | |
config.vm.provider "virtualbox" do |vb| | |
vb.name = "vagrant_grafana" | |
vb.memory = memory | |
end | |
end |
This file contains hidden or 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
#!/bin/bash | |
set -o errexit | |
echo "Installing Devops" | |
# Change language | |
# sudo apt install -y language-pack-zh-hans | |
sudo locale-gen zh_CN.UTF-8 | |
# Repository of Aliyun | |
sudo bash -c "cat > /etc/apt/sources.list" << EOF | |
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse | |
EOF | |
# Repository of grafana | |
sudo bash -c "cat > /etc/apt/sources.list.d/grafana.list" << EOF | |
deb https://packagecloud.io/grafana/stable/debian/ jessie main | |
EOF | |
curl https://packagecloud.io/gpg.key | sudo apt-key add - | |
# Unlock broken apt | |
# sudo rm /var/lib/apt/lists/lock | |
# sudo rm /var/cache/apt/archives/lock | |
# sudo rm /var/lib/dpkg/lock | |
sudo apt update | |
sudo apt upgrade -y | |
# sudo apt install grafana | |
# apt-cache show grafana | |
# cd @local-apt-repo | |
# wget https://packagecloud.io/grafana/stable/debian/pool/jessie/main/g/grafana/grafana_4.1.1-1484211277_amd64.deb | |
sudo apt install -y adduser libfontconfig | |
sudo dpkg -i /local-apt-repo/grafana_4.1.1-1484211277_amd64.deb | |
# cd @local-apt-repo | |
# wget https://dl.influxdata.com/influxdb/releases/influxdb_1.2.0_amd64.deb | |
# or axel http://dl.influxdata.com/influxdb/releases/influxdb_1.2.0_amd64.deb | |
sudo dpkg -i /local-apt-repo/influxdb_1.2.0_amd64.deb | |
# Restart service | |
# sudo service grafana-server restart | |
# sudo service influxdb restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment