forked from roland-hochmuth/monasca-bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup_procedure
98 lines (86 loc) · 3.69 KB
/
setup_procedure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# update locale
sudo update-locale LC_ALL=en_US.UTF-8
sudo vi /etc/hosts # add monasca as localhost
# install pip
sudo apt-get update
sudo apt-get install python-pip
# install apache
sudo apt-get install apache2 libapache2-mod-wsgi
# install docker
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
#install Docker Compose
sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo vi /etc/group
# deploy monasca-docker (moved to notebook)
#git clone https://github.com/monasca/monasca-docker.git
#pushd monasca-docker
#docker-compose up -d
#popd
# install django
sudo pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike django
# install horizon
git clone https://github.com/witekest/monasca-bootcamp.git
git clone https://git.openstack.org/openstack/horizon -b stable/pike --depth=1
pushd horizon
sudo pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike .
cp ~/monasca-bootcamp/setup/files/local_settings.py openstack_dashboard/local/local_settings.py
popd
# install monasca-ui
sudo pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike python-monascaclient
git clone https://git.openstack.org/openstack/monasca-ui
pushd monasca-ui
sudo pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike .
ln -f monitoring/enabled/_50_admin_add_monitoring_panel.py ~/horizon/openstack_dashboard/local/enabled/_50_admin_add_monitoring_panel.py
ln -f monitoring/conf/monitoring_policy.json ~/horizon/openstack_dashboard/conf/monitoring_policy.json
ln -sfF /home/ubuntu/monasca-ui/monitoring /home/ubuntu/horizon/monitoring
cp ~/monasca-bootcamp/setup/files/monasca_local_settings.py monitoring/config/local_settings.py
vi monitoring/config/local_settings.py
# update GRAFANA_URL
popd
pushd /etc/apache2/sites-available/
sudo cp ~/monasca-bootcamp/setup/files/horizon.conf .
sudo rm ../sites-enabled/000-default.conf
sudo ln -s ../sites-available/horizon.conf .
popd
./horizon/manage.py collectstatic
./horizon/manage.py compress
sudo a2ensite horizon
sudo service apache2 restart
# istall monasca-agent
sudo -s
pip install virtualenv
cd /opt
virtualenv monasca-agent
source monasca-agent/bin/activate
pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike monasca-agent
deactivate
exit
# install log-agent
sudo apt-get install openjdk-8-jre-headless
wget https://download.elastic.co/logstash/logstash/logstash-2.4.1.tar.gz
sudo tar zxf logstash-2.4.1.tar.gz -C /opt/
sudo chown -R ubuntu /opt/logstash-2.4.1/
sudo ln -sf /opt/logstash-2.4.1/ /opt/logstash
/opt/logstash/bin/logstash-plugin install logstash-output-monasca_log_api
sudo mkdir /etc/monasca
sudo mkdir /var/log/monasca/log-agent
sudo cp monasca-bootcamp/setup/files/log-agent.conf /etc/monasca/log-agent.conf
sudo cp monasca-bootcamp/setup/files/monasca-log-agent.service /etc/systemd/system/monasca-log-agent.service
# install stress-ng
sudo apt-get install stress-ng
# install Jupyter
sudo -s
cd /opt
virtualenv jupyter
source jupyter/bin/activate
pip install jupyter
pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike python-monascaclient
deactivate
exit