Running a Standalone WSO2 IoT Server.

WSO2 IoT Server can be run on single instance with simple configurations. WSO2 IoT server consists of 3 major services.
  1. IoT Core — This service includes all the major device management capabilities such as operation, policy management etc. It also includes the security and API management capabilities.
  2. Analytics — This service includes components for data gathering and analysis in both real-time and batch. It also includes the capability to do machine learning as well complex event processing and fraud detection.
  3. Broker — This service acts as the message exchanger between server and devices.
By default, WSO2 IoT server uses OAuth as the security mechanism. When a user login into the devicemgt user interface, it uses the OAuth token to validate the user in the underlying infrastructure. It supports few OAuth grant types and by default devicemgt application user the JWT token grant type.
And by default WSO2 IoT Server runs as with the hostname as localhost. If you do not have localhost configured in /etc/hosts file on your machine, the server will not work as intended. And even you start the server with localhost configured, you will be able to enroll a device because devices cannot locate the server by referring to localhost. Therefore devices will require an IP or accessible hostname. By “Accessible”, I meant that device should be able to resolve the hostname or the IP of the server regardless of the network they are connected. If the device can access the server in ports (8243, 8280) that would be sufficient. And (9443, 9763) ports should be opened in the server too. Therefore best approach is the configure the WSO2 IoT Server to the IP or the hostname of the machine.
So to configure the WSO2 IoT server in a single instance to IP or hostname, please go the <IoT_Home>/scripts folder run the change-ip.sh script. This script will make sure that WSO2 IoT server is configured with your IP or hostname address. Before you run the script, please make sure that “sed” command is available on your machine. And “keytool” is also a must to run the script.
When the script is running, it will ask for some questions to generate the SSL certificates, please answer them correctly. Especially the common name of the certificate. It should be either hostname or the IP of the server. Otherwise, the server will not work as intended and it will start throwing errors “JWT token validation failed”. After successfully completing the script running server is ready to enroll devices.

Comments

Popular posts from this blog

WSO2 ESB Removing full soap header using enrich mediator.

Getting started with WSO2 Device Cloud APIs