forked from mistio/mist-ce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
191 lines (113 loc) · 7.21 KB
/
README.txt
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
mist.io
=======
Mist.io helps you manage and monitor your virtual machines, across different
clouds, using any device that can access the web. It is provided under the
GNU AGPL v3.0 License. Check out the freemium service at https://mist.io
Installation
------------
Mist.io is written in Python. Currently it is tested and developed using
Python 2.7. The only system wide requirements are Python, Python header
files and some basic build tools. Git is used for revision control. Every other
dependency is build automatically via zc.buildout. Although we use zc.buildout
it is recommended to install mist.io in a virtualenv to avoid conflicts with
eggs in the system's Python.
To install the basic requirements in a **Debian** based distro do::
sudo aptitude install gcc python-dev build-essential git erlang libpcre3-dev python-lxml python-virtualenv
In **Red Hat** based systems the following packages need to be installed::
sudo yum install git python-virtualenv python-dev erlang pcre python-lxml gcc libxml2 libxml2-python libxml2-devel python-zc-buildout
If you run the command erl after that and it is not found, then package erlang might be missing from the official repos so it needs to be installed manually::
sudo yum install wget -y
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
sudo rpm -Uvh remi-release-7.rpm epel-release-7-5.noarch.rpm
sudo yum install erlang -y
For **openSUSE** distibution, you'll have to additionally install::
sudo zypper in python-gevent libevent-devel
In **MacOSX** you have to install Xcode and its command line tools. For virtualenv
you simply run::
sudo easy_install virtualenv
Supposing you have all the above, the steps are simple. Login as user, clone the repository,
create a virtualenv and run buildout. This will fail if you run it as root or with sudo, so make sure you run it as user ::
git clone https://github.com/mistio/mist.io.git
cd mist.io
virtualenv --no-site-packages .
./bin/python bootstrap.py
./bin/buildout -v
If you plan to support **KVM** you should install libvirt library::
For Debian systems::
sudo aptitude install libvirt-bin libvirt-dev
./bin/pip install libvirt-python
While for Redhat based::
yum install libvirt-devel -y
./bin/pip install libvirt-python
For **vSphere** support, you should install pyvmomi library::
./bin/pip install pyvmomi
In case you are using an older version of setuptools, bootstrap will fail. To
solve this you need to::
./bin/pip install setuptools --upgrade
If you are using Python 2.6 you'll have to install ipython version 1, otherwise buildout will fail::
./bin/pip install ipython==1
In MacOSX in case you are using Xcode 7 buildout will fail. To solve this you need to::
CFLAGS='-std=c99' ./bin/buildout -v
Deployment
----------
Mist.io comes with supervisor in order to handle all the processes.
To get it up and running::
./bin/supervisord
For development you can tail the logs::
tail -f var/log/*.log
You can also monitor that all the processes are up and running::
./bin/supervisorctl status
Finally, you can start, stop or restart a specific process::
./bin/supervisorctl restart uwsgi
Point your browser to http://127.0.0.1:8000 and you are ready to roll!
FAQ
---
I install mist.io and visit http://localhost:8000 but I don't see anything
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make sure all services are running::
user@user:~/mist.io$ ./bin/supervisorctl status
celery RUNNING pid 15169, uptime 0:00:02
haproxy RUNNING pid 15165, uptime 0:00:02
hub-shell RUNNING pid 15172, uptime 0:00:02
memcache RUNNING pid 15170, uptime 0:00:02
rabbitmq RUNNING pid 15168, uptime 0:00:02
sockjs RUNNING pid 15166, uptime 0:00:02
uwsgi RUNNING pid 15167, uptime 0:00:02
if you don't see a service as RUNNING then mist.io won't be able to start properly. Make sure that all dependencies have been added to the system before running the buildout, if not install them and re-run the buildout. Also have a look on the logs that are on var/log dir::
user@user:~/mist.io$ tail -f var/log/*.log
How to change mist.io listen address
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default mist.io binds on the localhost interface, if you want to change this behavior edit haproxy.conf and change the line::
frontend www localhost:8000
to::
frontend www 0.0.0.0:8000
then restart haproxy::
user@user:~/mist.io$ ./bin/supervisorctl restart haproxy
Make sure that no other service has already binded on port 8000. It should now load on http://your_ip:8000
If this does not load check if a local firewall policy denies incoming access to port 8000, or if your provider denies incoming access to port 8000 (eg the default ec2 policy for some regions)
Process rabbitmq is not running
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First make sure that erlang is installed, otherwise it won't be able to start (on RedHat based OS you might have to install it manually, see the install section). On some Ubuntu systems there's an error that prevents rabbitmq from starting correctly, if that's the case for you try to start epmd manually and then restart rabbitmq::
user@user:~/mist.io$ ./bin/supervisorctl status rabbitmq
rabbitmq STARTING
user@user:~/mist.io$ epmd -daemon && ./bin/supervisorctl restart rabbitmq
user@user:~/mist.io$ ./bin/supervisorctl status rabbitmq
rabbitmq RUNNING pid 18808, uptime 0:00:06
Do you have an official mist.io docker image?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sure, find it on https://registry.hub.docker.com/u/mist/mistio/
With docker installed on your system, you just need to pull it and start a container::
root@client-monit:~$ docker pull mist/mistio
Pulling repository mist/mistio
...
...
Status: Downloaded newer image for mist/mistio:latest
root@client-monit:~$ docker run -d -p 8000:8000 mist/mistio
8da5cc47bca22a5d1da729c4b23382c90ae0aaec50bcc2d608e9bea783b5b8a3
The above commands, pulled the docker image, started it as a daemon, and exposed it to port 8000. You can now launch a browser on your ip:8000, eg http://104.236.188.180:8000/ and you should see the Mist.io UI.
You can find more info on http://docs.mist.io/article/39-installation
How to add authentication to mist.io dashboard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default mist.io listens on port 8000 on the localhost interface. You can use nginx and expose this port to port 80 and add http basic authentication there, or you can expose port 8000 on external interfaces (see the seconds section on the FAQ for this) and add http basic authentication there. The last one can be achieved with editing haproxy.conf file and adding 4 lines, as it has been suggested by @paimpozhil here https://github.com/mistio/mist.io/pull/213/files. Make sure you restart haproxy after the edits::
user@user:~/mist.io$ ./bin/supervisorctl restart haproxy