Installation of thingsboard

thingsboard

Resources needed for thingsboard

  1. openjdk11 ( Note: The version of openjdk must use version 11, other versions will not work)

    • openjdk installation

      1. Official website
      https://adoptium.net/zh-CN/
      

      Insert image description here

Click to download any version for other platforms

Insert image description here

After the download is complete, just install it

  • openjdk environment configuration

    After the installation is complete, check whether the installation has been successful and whether the environment variables have been set.

    java -version
    

    If the installation is successful, the version of openjdk we installed will be displayed.

    Insert image description here

    If it is not displayed, open the environment variables and add the installation address of openjdk to the path in the system variables. ( Note: When adding, you must add the address of the bin folder location.)

  1. PostgreSQL

    • PostgreSQL installation

      1. official

        https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows
        

      Insert image description here

      Click to download the appropriate configuration for your computer. If you don’t know the configuration of your computer, you can see the configuration by right-clicking on the computer’s properties.
      Insert image description here

      If the system type here is 32-bit, choose 32-bit, and if it is 64-bit, just choose 64-bit.

      Note: The installation method is the same as other software (you need to enter a password when installing,just enter the default password postgres shown above).

      img

      Do not modify the port.

      img

      Finally, click OK and remove the check mark above.

      img

      Installed.

  2. navicat15, or navicat 16 (the navicat15 version may not be able to connect to PostgreSQL, in which case use the navicat16 version)

    • Install navicat16

      1. Official download address

        https://www.navicat.com.cn/products
        

        After clicking on the free trial, navicat16 will be automatically downloaded. The installation method is the same as for other applications.

        Insert image description here

        I won’t go into details about the installation method. If you don’t know, click on the csdn navicat16 installation method below to see the installation method.

        csdn navicat16 installation method

Download the resources file of thingsboard

  • Download method:

    • download link:

      https://github.com/thingsboard/thingsboard/releases/download/v3.5.1/thingsboard-windows-3.5.1.zip
      

      Just decompress it and use it.

      After decompression, you need to configure these parameters

      1. Password configuration (C:\Program Files (x86) is the path where you decompressed it)

        C:\Program Files (x86)\thingsboard\conf\thingsboard.yml
        

        After opening it, search for #SQL DAO Configuration and then modify it. Generally, the password itself has a default password, but it is recommended to check whether it is correct.

        # SQL DAO Configuration
        spring:
          data:
            jpa:
              repositories:
                enabled: "true"
          jpa:
            open-in-view: "false"
            hibernate:
              ddl-auto: "none"
          datasource:
            driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}"
            url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/thingsboard}"
            username: "${SPRING_DATASOURCE_USERNAME:postgres}"
            // 修改的地方就是YOUR_POSTGRES_PASSWORD_HERE修改到postgres就可以啦。
            password: "${SPRING_DATASOURCE_PASSWORD:YOUR_POSTGRES_PASSWORD_HERE}"
            hikari:
              maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:5}"
        
  • Connect to the database

    • After opening the navicat16 software, there is a connection on it. After clicking, PostgreSql is displayed.

      Insert image description here

      Click in and enter your name and password

      Insert image description here

    • Create database

      Insert image description here

  • Run the downloaded thingsboard

    • How to run:

      • Click win, search for cmd, and click administrator run to open cmd. Otherwise, an error will occur during the operation, or the dependent files will not be completed successfully.

      • Open the location of the unzipped thingsboard folder, copy and paste it and press Enter. Methods as below:

        cd "C:\Program Files (x86)\thingsboard"
        

        If you do not want to switch your path after pressing Enter, enter the following code: If it is another drive such as E drive, enter E:.

        C:
        
      • After entering, enter the following code

        install.bat --loadDemo
        

        If it is successful, the best result will be like this

        C:\Program Files (x86)\thingsboard>install.bat --loadDemo
        Detecting Java version installed.
        CurrentVersion 110
        Java 11 found!
        Installing thingsboard ...
        ...
        ThingsBoard installed successfully!
        

        If this does not happen, try again, or see if your cmd is opened in administrator mode. If it is opened in administrator mode, please check whether there are files in the thingsboard database in the navicat16 software. If so, delete them. Just recompile after dropping it.

    • Start thingsboard service

      Start service

      net start thingsboard
      

      If it starts normally, you will be prompted that the service started successfully . If not, then check to see if your cmd is running as an administrator.

      • After running cmd, the thingsboard file in C:\Program Files (x86)\thingsboard\logs is opened and started successfully.

        2023-07-20 12:27:13,375 [sql-log-1-thread-1] INFO  o.t.s.dao.sql.TbSqlBlockingQueue - Queue-1 [TS] queueSize [0] totalAdded [2] totalSaved [2] totalFailed [0]
        2023-07-20 12:27:13,375 [sql-log-1-thread-1] INFO  o.t.s.dao.sql.TbSqlBlockingQueue - Queue-2 [TS] queueSize [0] totalAdded [9] totalSaved [9] totalFailed [0]
        

        The last two sentences in the thingsboard file say that the service has been successfully started.

        Note: If not, the error message says that there is a problem with mqtt, open the thingsboard.yml file in C:\Program Files (x86)\thingsboard\conf and search for this statement

        ${MQTT_BIND_PORT:1883}
        

        Then just modify the port numbers of the mqtt client and server here.

        ${MQTT_BIND_PORT:1884}
        

      Out of service

      net stop thingsboard
      
    • Go online and enter the address below to see if you can access the thingsboard website normally.

      http://localhost:8080/
      

      This will allow normal access

      Account number and password:

      1. Super administrator : [email protected] / sysadmin
      2. Administrator : [email protected]/tenant
      3. Ordinary users : [email protected] / customer
  • Go online and enter the address below to see if you can access the thingsboard website normally.

    http://localhost:8080/
    

    There will be updates later. Remember to like and follow

Guess you like

Origin blog.csdn.net/qq_60568498/article/details/131828154