diff options
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 87 |
1 files changed, 41 insertions, 46 deletions
@@ -29,9 +29,9 @@ According to the `Openstack Documentation <https://docs.openstack.org/>`_ instal | |||
29 | - Message queue | 29 | - Message queue |
30 | - Memcached | 30 | - Memcached |
31 | - Keystone | 31 | - Keystone |
32 | 32 | ||
33 | Creation of the database | 33 | Creation of the database |
34 | ---------------------- | 34 | ------------------------- |
35 | On the dbms create the iotronic db and configure the access for the user iotronic:: | 35 | On the dbms create the iotronic db and configure the access for the user iotronic:: |
36 | 36 | ||
37 | MariaDB [(none)]> CREATE DATABASE iotronic; | 37 | MariaDB [(none)]> CREATE DATABASE iotronic; |
@@ -49,13 +49,13 @@ Add the user and the enpoints on Keystone:: | |||
49 | openstack role add manager_iot_project | 49 | openstack role add manager_iot_project |
50 | openstack role add user_iot | 50 | openstack role add user_iot |
51 | 51 | ||
52 | openstack endpoint create --region RegionOne iot public http://IP_IOTRONIC:1288 | 52 | openstack endpoint create --region RegionOne iot public http://IP_IOTRONIC:8812 |
53 | openstack endpoint create --region RegionOne iot internal http://IP_IOTRONIC:1288 | 53 | openstack endpoint create --region RegionOne iot internal http://IP_IOTRONIC:8812 |
54 | openstack endpoint create --region RegionOne iot admin http://1IP_IOTRONIC:1288 | 54 | openstack endpoint create --region RegionOne iot admin http://1IP_IOTRONIC:8812 |
55 | 55 | ||
56 | 56 | ||
57 | Configuring Iotronic Host | 57 | Configuring Iotronic Host |
58 | ---------------------- | 58 | -------------------------- |
59 | 59 | ||
60 | Crossbar | 60 | Crossbar |
61 | ^^^^^^^^^^^^^^^^^^^^^ | 61 | ^^^^^^^^^^^^^^^^^^^^^ |
@@ -68,74 +68,69 @@ Get the source:: | |||
68 | 68 | ||
69 | git clone https://github.com/openstack/iotronic.git | 69 | git clone https://github.com/openstack/iotronic.git |
70 | 70 | ||
71 | install the python-mysqldb:: | 71 | add the user iotronic:: |
72 | 72 | ||
73 | sudo apt-get install python-mysqldb | 73 | useradd -m -d /var/lib/iotronic iotronic |
74 | 74 | ||
75 | and Iotronic:: | 75 | and Iotronic:: |
76 | 76 | ||
77 | cd iotronic | 77 | cd iotronic |
78 | sudo pip install -r requirements.txt | 78 | pip3 install -r requirements.txt |
79 | sudo pip install twisted | 79 | python3 setup.py install |
80 | sudo pip install paramiko | ||
81 | sudo python setup.py install | ||
82 | 80 | ||
83 | create a log dir:: | 81 | create a log dir:: |
84 | 82 | ||
85 | mkdir -p /var/log/iotronic | 83 | mkdir -p /var/log/iotronic |
84 | chown -R iotronic:iotronic /var/log/iotronic/ | ||
85 | |||
86 | edit ``/etc/iotronic/iotronic.conf`` with the correct configuration:: | ||
87 | |||
88 | nano /etc/iotronic/iotronic.conf | ||
89 | |||
90 | There is just one wamp-agent and it must be set as the registration agent:: | ||
91 | |||
92 | register_agent = True | ||
86 | 93 | ||
87 | populate the database:: | 94 | populate the database:: |
88 | 95 | ||
89 | cd iotronic/utils | 96 | iotronic-dbsync |
90 | ./loaddb MYSQL_IP_ON_CONTROLLER | 97 | |
91 | 98 | ||
92 | API Service Configuration | 99 | API Service Configuration |
93 | ^^^^^^^^^^^^^^^^^^^^^ | 100 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
94 | Install apache and the other components:: | 101 | Install apache and the other components:: |
95 | 102 | ||
96 | sudo apt-get install apache2 python-setuptools libapache2-mod-wsgi libssl-dev | 103 | sudo apt-get install apache2 python-setuptools libapache2-mod-wsgi-py3 |
97 | 104 | ||
98 | create ``/etc/apache2/conf-enabled/iotronic.conf`` and copy the following content:: | 105 | create log directory:: |
99 | 106 | ||
100 | Listen 1288 | 107 | touch /var/log/iotronic/iotronic-api_error.log |
101 | <VirtualHost *:1288> | 108 | touch /var/log/iotronic/iotronic-api_access.log |
102 | WSGIDaemonProcess iotronic | 109 | chown -R iotronic:iotronic /var/log/iotronic/ |
103 | #user=root group=root threads=10 display-name=%{GROUP} | ||
104 | WSGIScriptAlias / /var/www/cgi-bin/iotronic/app.wsgi | ||
105 | 110 | ||
106 | #SetEnv APACHE_RUN_USER stack | 111 | copy the config apache2 file:: |
107 | #SetEnv APACHE_RUN_GROUP stack | ||
108 | WSGIProcessGroup iotronic | ||
109 | 112 | ||
110 | ErrorLog /var/log/iotronic/iotronic-api_error.log | 113 | cp etc/apache2/iotronic.conf /etc/apache2/sites-available/iotronic.conf |
111 | LogLevel debug | ||
112 | CustomLog /var/log/iotronic/iotronic-api_access.log combined | ||
113 | 114 | ||
114 | <Directory /etc/iotronic> | 115 | enable the configuration:: |
115 | WSGIProcessGroup iotronic | ||
116 | WSGIApplicationGroup %{GLOBAL} | ||
117 | AllowOverride All | ||
118 | Require all granted | ||
119 | </Directory> | ||
120 | </VirtualHost> | ||
121 | 116 | ||
122 | edit ``/etc/iotronic/iotronic.conf`` with the correct configuration. | 117 | a2ensite /etc/apache2/sites-available/iotronic.conf |
123 | |||
124 | There is just one wamp-agent and it must be set as the registration agent:: | ||
125 | |||
126 | register_agent = True | ||
127 | 118 | ||
128 | restart apache:: | 119 | restart apache:: |
129 | 120 | ||
130 | systemctl restart apache2 | 121 | systemctl restart apache2 |
131 | 122 | ||
132 | Start the service (better use screen):: | ||
133 | 123 | ||
134 | screen -S conductor | 124 | Starting |
135 | iotronic-conductor | 125 | ^^^^^^^^^^^^^^^^^^^^^ |
126 | Start the service:: | ||
127 | |||
128 | systemctl enable iotronic-wamp-agent | ||
129 | systemctl start iotronic-wamp-agent | ||
130 | |||
131 | systemctl enable iotronic-conductor | ||
132 | systemctl start iotronic-conductor | ||
136 | 133 | ||
137 | screen -S agent | ||
138 | iotronic-wamp-agent | ||
139 | 134 | ||
140 | Board Side | 135 | Board Side |
141 | ---------------------- | 136 | ---------------------- |