Skip to content

Commit 3d22229

Browse files
edited the installation guide with MQTT
1 parent 659294c commit 3d22229

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

source/installation-guide/installation-guide.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,31 +278,37 @@ Defaults are set in :code:`OS2IoT-frontend/src/environments/environment.ts`
278278
OS2IoT-Mosquitto broker
279279
^^^^^^^^^^^^^^^^^^^^^^^
280280
281-
To get the mosquitto broker working, you have to create some certificates and update some values. These following steps is done with Windows and it's required that you have openssl installed. If you use linux, then write :code:`sudo` before the commands (you still have to install openssl).
281+
To get the mosquitto broker working, you have to create some certificates and update some values. These following steps is done with Windows. If you use linux, then write :code:`sudo` before the commands.
282+
283+
Prerequisites: openssl installed and accesible from path
284+
285+
Generate files:
282286
283287
1. Open the command prompt in administrator mode.
284-
285-
2. The following certificates and keys HAS to be placed in the folder "OS2IoT-docker/configuration/mosquitto-broker-os2iot", so it's recommended to navigate to that folder from the start.
286288
287-
3. Create a certificate authority(CA) key with this command: :code:`openssl genrsa -des3 -out ca.key 2048`. You will be prompted to enter a password. It's very important that you save this password, since it will be used later.
289+
2. Create a certificate authority(CA) key with this command: :code:`openssl genrsa -des3 -out ca.key 2048`. You will be prompted to enter a password. It's very important that you save this password, since it will be used later.
288290
289-
4. Create the CA certificate with this command: :code:`openssl req -new -x509 -days 1826 -key ca.key -out ca.crt`. You will be asked to enter the password from the step before. After this, you will be prompted to enter informations. These values are not important, except one: "Common name". Common name HAS to be the ip/hostname of your broker.
291+
3. Create the CA certificate with this command: :code:`openssl req -new -x509 -days 1826 -key ca.key -out ca.crt`. You will be asked to enter the password from the step before. After this, you will be prompted to enter informations. These values are not important, except one: "Common name". Common name HAS to be the ip/hostname of your broker.
290292
291-
5. Create the server key (for the broker) with the command: :code:`openssl genrsa -out server.key 2048`
293+
4. Create the server key (for the broker) with the command: :code:`openssl genrsa -out server.key 2048`
292294
293295
6. Create the server signing request with the command: :code:`openssl req -new -out server.csr -key server.key`. You will be prompted to enter some informations. These values are not important, except one: "Common name". Common name HAS to be the ip/hostname of your broker. The rest of the values should not be exact the same as in step 4.
294296
295297
7. Create the server certificate (that is signed by the CA) with this command: :code:`openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 360`. You will be prompted to enter the password from step 3.
296298
297-
8. If the ca.crt, ca.key, server.crt and server.key aren't placed in the folder "OS2IoT-docker/configuration/mosquitto-broker-os2iot" then place them in that folder.
299+
If you want to get docker container with mosquitto running, then follow these steps:
300+
301+
1. Place the generated files, ca.key, ca.crt, server.key and server.crt from the above steps in the folder "OS2IoT-docker/configuration/mosquitto-broker-os2iot". You don't need the server.csr.
302+
303+
2. Open the mosquitto-os2iot.conf file placed in OS2IoT-docker/configuration/mosquitto-broker-os2iot in a text editor and update the values to match your database.
298304
299-
9. Open the mosquitto-os2iot.conf file placed in OS2IoT-docker/configuration/mosquitto-broker-os2iot in a text editor and update the values about your database.
305+
3. Copy the files ca.crt and ca.key and place them in OS2IoT-backend/resources.
300306
301-
10. Copy the files ca.crt and ca.key and place them in OS2IoT-backend/resources.
307+
4. Update the :code:`MQTT_BROKER_HOSTNAME` with the ip/hostname that you used for step 4 and 6, and :code:`CA_KEY_PASSWORD` with the password that you entered in step 3 in the docker-compose.yml file placed in OS2IoT-docker.
302308
303-
11. Update the :code:`MQTT_BROKER_HOSTNAME` with the ip/hostname that you used for step 4 and 6, and :code:`CA_KEY_PASSWORD` with the password that you entered in step 3 in the docker-compose.yml file placed in OS2IoT-docker.
309+
If you want to use kubernetes to host mosquitto then you need some futher steps.
304310
305-
If you want to use kubernetes to host mosquitto then you need some futher steps. First you have to install kubectl.
311+
Prerequisites: kubectl installed and accesible from path
306312
307313
1. Open a command prompt in administrator mode.
308314

0 commit comments

Comments
 (0)