Browse Source

Improve centos and ubuntu instruction for edge

pull/9245/head
Andrii Landiak 3 years ago
parent
commit
8412b61812
  1. 58
      application/src/main/data/json/edge/install_instructions/centos/instructions.md
  2. 2
      application/src/main/data/json/edge/install_instructions/docker/instructions.md
  3. 55
      application/src/main/data/json/edge/install_instructions/ubuntu/instructions.md
  4. 2
      application/src/main/java/org/thingsboard/server/controller/EdgeController.java

58
application/src/main/data/json/edge/install_instructions/centos/instructions.md

@ -158,21 +158,65 @@ sudo rpm -Uvh tb-edge-${TB_EDGE_VERSION}.rpm
{: .copy-code} {: .copy-code}
### Configure ThingsBoard Edge ### Configure ThingsBoard Edge
To configure ThingsBoard Edge, you can either manually edit the configuration file or use a command to automate the process.
#### Automated Configuration
You can use the following command to automatically update the configuration file with specific values:
```bash
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY}
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET}
export CLOUD_RPC_HOST=${BASE_URL}
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT}
export CLOUD_RPC_SSL_ENABLED=${CLOUD_RPC_SSL_ENABLED}
EOL'
```
{: .copy-code}
#### Manual Configuration
```bash
sudo nano /etc/tb-edge/conf/tb-edge.conf
```
{: .copy-code}
Please update the following lines in your configuration file. Make sure to replace:
```text
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY}
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET}
export CLOUD_RPC_HOST=${BASE_URL}
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT}
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE
```
#### [Optional] Update bind ports #### [Optional] Update bind ports
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update docker compose port mapping to avoid port collision between ThingsBoard server and ThingsBoard Edge. If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update configuration parameters to avoid port collision between ThingsBoard server and ThingsBoard Edge.
Please uncomment the following parameters in the ThingsBoard Edge configuration file (**/etc/tb-edge/conf/tb-edge.conf**):
```text
export HTTP_BIND_PORT=18080
export MQTT_BIND_PORT=11883
export COAP_BIND_PORT=15683
export LWM2M_ENABLED=false
```
Please update next lines of `docker-compose.yml` file: Or update using command:
```bash ```bash
ports: sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
- "18080:8080" export HTTP_BIND_PORT=18080
- "11883:1883" export MQTT_BIND_PORT=11883
- "15683-15688:5683-5688/udp" export COAP_BIND_PORT=15683
export LWM2M_ENABLED=false
EOL'
``` ```
Make sure that ports above (18080, 11883, 15683-15688) are not used by any other application. {: .copy-code}
Make sure that ports above (18080, 11883, 15683-15688) are not used by any other application.
#### Run installation script #### Run installation script
Once ThingsBoard Edge is installed and configured please execute the following install script: Once ThingsBoard Edge is installed and configured please execute the following install script:

2
application/src/main/data/json/edge/install_instructions/docker/instructions.md

@ -69,7 +69,7 @@ If ThingsBoard Edge is going to be running on the same machine where ThingsBoard
Please update next lines of `docker-compose.yml` file: Please update next lines of `docker-compose.yml` file:
```bash ```text
ports: ports:
- "18080:8080" - "18080:8080"
- "11883:1883" - "11883:1883"

55
application/src/main/data/json/edge/install_instructions/ubuntu/instructions.md

@ -86,10 +86,57 @@ Go to the download repository and install ThingsBoard Edge service
```bash ```bash
sudo dpkg -i tb-edge-{TB_EDGE_VERSION}.deb sudo dpkg -i tb-edge-{TB_EDGE_VERSION}.deb
{:copy-code}
``` ```
{: .copy-code}
### Configure ThingsBoard Edge
To configure ThingsBoard Edge, you can either manually edit the configuration file or use a command to automate the process.
#### Automated Configuration
You can use the following command to automatically update the configuration file with specific values:
```bash
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY}
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET}
export CLOUD_RPC_HOST=${BASE_URL}
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT}
export CLOUD_RPC_SSL_ENABLED=${CLOUD_RPC_SSL_ENABLED}
EOL'
```
{: .copy-code}
#### Manual Configuration
```bash
sudo nano /etc/tb-edge/conf/tb-edge.conf
```
{: .copy-code}
Please update the following lines in your configuration file. Make sure to replace:
Edit ThingsBoard Edge configuration file ```text
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY}
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET}
export CLOUD_RPC_HOST=${BASE_URL}
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT}
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE
```
#### [Optional] Update bind ports
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update configuration parameters to avoid port collision between ThingsBoard server and ThingsBoard Edge.
Please uncomment the following parameters in the ThingsBoard Edge configuration file (**/etc/tb-edge/conf/tb-edge.conf**):
```text
export HTTP_BIND_PORT=18080
export MQTT_BIND_PORT=11883
export COAP_BIND_PORT=15683
export LWM2M_ENABLED=false
```
Or update using command:
```bash ```bash
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
@ -98,8 +145,10 @@ export MQTT_BIND_PORT=11883
export COAP_BIND_PORT=15683 export COAP_BIND_PORT=15683
export LWM2M_ENABLED=false export LWM2M_ENABLED=false
EOL' EOL'
{:copy-code}
``` ```
{: .copy-code}
Make sure that ports above (18080, 11883, 15683-15688) are not used by any other application.
#### Run installation script #### Run installation script

2
application/src/main/java/org/thingsboard/server/controller/EdgeController.java

@ -562,7 +562,7 @@ public class EdgeController extends BaseController {
public EdgeInstallInstructions getEdgeDockerInstallInstructions( public EdgeInstallInstructions getEdgeDockerInstallInstructions(
@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION, required = true) @ApiParam(value = EDGE_ID_PARAM_DESCRIPTION, required = true)
@PathVariable("edgeId") String strEdgeId, @PathVariable("edgeId") String strEdgeId,
@ApiParam(value = "Installation method (e.g., 'docker', 'ubuntu', 'centos')") @ApiParam(value = "Installation method ('docker', 'ubuntu' or 'centos')")
@PathVariable("method") String installationMethod, @PathVariable("method") String installationMethod,
HttpServletRequest request) throws ThingsboardException { HttpServletRequest request) throws ThingsboardException {
if (isEdgesEnabled() && edgeInstallServiceOpt.isPresent()) { if (isEdgesEnabled() && edgeInstallServiceOpt.isPresent()) {

Loading…
Cancel
Save