Skip to content

Commit

Permalink
Merge pull request #1479 from trikimiki/develop/3.7
Browse files Browse the repository at this point in the history
update install docs for JDK17
  • Loading branch information
ashvayka committed Jun 13, 2024
2 parents 1a6c87c + fb9da63 commit 45f7203
Show file tree
Hide file tree
Showing 30 changed files with 246 additions and 332 deletions.
23 changes: 1 addition & 22 deletions _includes/templates/install/cassandra-rhel-install.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
Instructions listed below will help you to install Cassandra.

```bash
# Add cassandra repository
cat << EOF | sudo tee /etc/yum.repos.d/cassandra.repo > /dev/null
[cassandra]
name=Apache Cassandra
baseurl=https://redhat.cassandra.apache.org/41x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://downloads.apache.org/cassandra/KEYS
EOF

# Cassandra installation
sudo yum install cassandra
# Tools installation
sudo yum install cassandra-tools
# Start Cassandra
sudo service cassandra start
# Configure the database to start automatically when OS starts.
sudo chkconfig cassandra on
```
Please follow [official Apache Cassandra installation guide](https://cassandra.apache.org/doc/latest/cassandra/installing/installing.html#install-as-rpm-package).

You can use Astra DB cloud instead installing your own Cassandra.
See how to [connect ThingsBoard to Astra DB](/docs/user-guide/install/pe/cassandra-cloud-astra-db/)
Expand Down
37 changes: 37 additions & 0 deletions _includes/templates/install/cassandra-ubuntu-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,42 @@ sudo apt-get install cassandra
sudo apt-get install cassandra-tools
```

In order to run Cassandra, you will need to install Java 11.

Install the package.
```bash
sudo apt install openjdk-11-jdk
```
{: .copy-code}
Set Java 17 as the default version (required for ThingsBoard).
```bash
sudo update-alternatives --config java
```
{: .copy-code}
Edit Cassandra config.
```bash
sudo nano /usr/share/cassandra/cassandra.in.sh
```
{: .copy-code}
Find the following line.
```bash
# JAVA_HOME can optionally be set here
#JAVA_HOME=/usr/local/jdk6
```
And replace it as follows:
```bash
# JAVA_HOME can optionally be set here
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
```
Then, restart Cassandra.
```bash
sudo service cassandra stop
```
{: .copy-code}
```bash
sudo service cassandra start
```
{: .copy-code}

You can use Astra DB cloud instead installing your own Cassandra.
See how to [connect ThingsBoard to Astra DB](/docs/user-guide/install/pe/cassandra-cloud-astra-db/)
43 changes: 23 additions & 20 deletions _includes/templates/install/docker-queue-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ nano docker-compose.yml
Add the following lines to the yml file.

```yml
version: '3.0'
version: '3.2'
services:
zookeeper:
restart: always
image: "zookeeper:3.5"
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zookeeper:2888:3888;zookeeper:2181
kafka:
restart: always
image: wurstmeister/kafka
depends_on:
- zookeeper
image: bitnami/kafka:3.5.2
ports:
- "9092:9092"
- 9092:9092 #to localhost:9092 from host machine
- 9093 #for Kraft
- 9094 #to kafka:9094 from within Docker network
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: INSIDE://:9093,OUTSIDE://:9092
KAFKA_ADVERTISED_LISTENERS: INSIDE://:9093,OUTSIDE://kafka:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_LISTENERS: "OUTSIDE://:9092,CONTROLLER://:9093,INSIDE://:9094"
KAFKA_CFG_ADVERTISED_LISTENERS: "OUTSIDE://localhost:9092,INSIDE://kafka:9094"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT,CONTROLLER:PLAINTEXT"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "INSIDE"
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: "1"
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: "1"
KAFKA_CFG_PROCESS_ROLES: "controller,broker" #KRaft
KAFKA_CFG_NODE_ID: "0" #KRaft
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER" #KRaft
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093" #KRaft
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- kafka-data:/bitnami
mytb:
restart: always
image: "thingsboard/tb-postgres"
Expand All @@ -48,9 +48,12 @@ services:
- "5683-5688:5683-5688/udp"
environment:
TB_QUEUE_TYPE: kafka
TB_KAFKA_SERVERS: kafka:9092
TB_KAFKA_SERVERS: kafka:9094
volumes:
- ~/.mytb-data:/data
- ~/.mytb-logs:/var/log/thingsboard
volumes:
kafka-data:
driver: local
```
{: .copy-code}
4 changes: 3 additions & 1 deletion _includes/templates/install/memory-on-slow-machines.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ Add the following lines to the configuration file.
# Update ThingsBoard memory usage and restrict it to 2G in /etc/thingsboard/conf/thingsboard.conf
export JAVA_OPTS="$JAVA_OPTS -Xms2G -Xmx2G"
```
{: .copy-code}
{: .copy-code}

We recommend adjusting these parameters depending on your server resources. It should be set to at least 2G (gigabytes), and increased accordingly if there is additional RAM space available. Usually, you need to set it to 1/2 of your total RAM if you do not run any other memory-intensive processes (e.g. Cassandra), or to 1/3 otherwise.
43 changes: 23 additions & 20 deletions _includes/templates/install/pe-docker-queue-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ nano docker-compose.yml
Add the following line to the yml file. Don’t forget to replace "PUT_YOUR_LICENSE_SECRET_HERE" with your **license secret obtained on the first step**:

```yml
version: '3.0'
version: '3.2'
services:
zookeeper:
restart: always
image: "zookeeper:3.5"
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zookeeper:2888:3888;zookeeper:2181
kafka:
restart: always
image: wurstmeister/kafka
depends_on:
- zookeeper
image: bitnami/kafka:3.5.2
ports:
- "9092:9092"
- 9092:9092 #to localhost:9092 from host machine
- 9093 #for Kraft
- 9094 #to kafka:9094 from within Docker network
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: INSIDE://:9093,OUTSIDE://:9092
KAFKA_ADVERTISED_LISTENERS: INSIDE://:9093,OUTSIDE://kafka:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_LISTENERS: "OUTSIDE://:9092,CONTROLLER://:9093,INSIDE://:9094"
KAFKA_CFG_ADVERTISED_LISTENERS: "OUTSIDE://localhost:9092,INSIDE://kafka:9094"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT,CONTROLLER:PLAINTEXT"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "INSIDE"
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: "1"
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: "1"
KAFKA_CFG_PROCESS_ROLES: "controller,broker" #KRaft
KAFKA_CFG_NODE_ID: "0" #KRaft
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER" #KRaft
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093" #KRaft
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- kafka-data:/bitnami
mytbpe:
restart: always
image: "thingsboard/tb-pe:{{ site.release.pe_full_ver }}"
Expand All @@ -49,7 +49,7 @@ services:
environment:
TB_QUEUE_TYPE: kafka
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/thingsboard
TB_KAFKA_SERVERS: kafka:9092
TB_KAFKA_SERVERS: kafka:9094
TB_LICENSE_SECRET: PUT_YOUR_LICENSE_SECRET_HERE
TB_LICENSE_INSTANCE_DATA_FILE: /data/license.data
volumes:
Expand All @@ -65,5 +65,8 @@ services:
POSTGRES_PASSWORD: postgres
volumes:
- ~/.mytbpe-data/db:/var/lib/postgresql/data
volumes:
kafka-data:
driver: local
```
{: .copy-code}
6 changes: 3 additions & 3 deletions _includes/templates/install/postgres-install-rhel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Instructions listed below will help you to install PostgreSQL.

```bash
# Update your system
sudo yum update
sudo dnf update
```
{: .copy-code}

Expand All @@ -12,15 +12,15 @@ Install the repository.

```bash
# Install the repository RPM:
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
```
{: .copy-code}

**For CentOS/RHEL 9:**

```bash
# Install the repository RPM:
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
```
{: .copy-code}

Expand Down
46 changes: 45 additions & 1 deletion _includes/templates/install/queue-kafka-in-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,48 @@

##### Install Kafka

Use this [instruction](https://github.com/wurstmeister/kafka-docker) for installing Kafka in Docker container.
Use the instructions below for installing Kafka in a Docker container.

```text
nano docker-compose-kafka.yml
```
{: .copy-code}

Add the following lines to the docker-compose-kafka.yml file:
```yml
version: '3.2'
services:
kafka:
restart: always
image: bitnami/kafka:3.5.2
ports:
- 9092:9092 #to localhost:9092 from host machine
- 9093 #for Kraft
- 9094 #to kafka:9094 from within Docker network
environment:
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_LISTENERS: "OUTSIDE://:9092,CONTROLLER://:9093,INSIDE://:9094"
KAFKA_CFG_ADVERTISED_LISTENERS: "OUTSIDE://localhost:9092,INSIDE://kafka:9094"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT,CONTROLLER:PLAINTEXT"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "INSIDE"
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: "1"
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: "1"
KAFKA_CFG_PROCESS_ROLES: "controller,broker" #KRaft
KAFKA_CFG_NODE_ID: "0" #KRaft
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER" #KRaft
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093" #KRaft
volumes:
- kafka-data:/bitnami
volumes:
kafka-data:
driver: local
```
{: .copy-code}

Start the container:
```text
docker compose -f docker-compose-kafka.yml up -d
```
{: .copy-code}
8 changes: 4 additions & 4 deletions _includes/templates/install/rhel-java-install.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ThingsBoard service is running on Java 11. Follow this instructions to install OpenJDK 11:
ThingsBoard service is running on Java 17. Follow this instructions to install OpenJDK 17:

```bash
sudo yum install java-11-openjdk
sudo dnf install java-17-openjdk
```
{: .copy-code}

Please don't forget to configure your operating system to use OpenJDK 11 by default.
Please don't forget to configure your operating system to use OpenJDK 17 by default.
You can configure which version is the default using the following command:

```bash
Expand All @@ -23,7 +23,7 @@ java -version
Expected command output is:

```text
openjdk version "11.0.xx"
openjdk version "17.x.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)
```
8 changes: 1 addition & 7 deletions _includes/templates/install/rhel-queue-kafka.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#### Kafka Installation

[Apache Kafka](https://kafka.apache.org/) is an open-source stream-processing software platform.

##### Install Kafka

We recommend to use Kafka in Docker container, use this [instruction](https://github.com/wurstmeister/kafka-docker) for installing.
{% include templates/install/queue-kafka-in-docker.md %}

##### ThingsBoard Configuration

Expand Down
10 changes: 5 additions & 5 deletions _includes/templates/install/ubuntu-java-install.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ThingsBoard service is running on Java 11. Follow this instructions to install OpenJDK 11:
ThingsBoard service is running on Java 17. Follow this instructions to install OpenJDK 17:

```bash
sudo apt update
sudo apt install openjdk-11-jdk
sudo apt install openjdk-17-jdk
```
{: .copy-code}

Please don't forget to configure your operating system to use OpenJDK 11 by default.
Please don't forget to configure your operating system to use OpenJDK 17 by default.
You can configure which version is the default using the following command:

```bash
Expand All @@ -24,7 +24,7 @@ java -version
Expected command output is:

```text
openjdk version "11.0.xx"
openjdk version "17.x.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)
OpenJDK 64-Bit Server VM (...)
```
4 changes: 2 additions & 2 deletions _includes/templates/install/windows-db-hybrid-timescale.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In this case, ThingsBoard will be storing timeseries data in TimescaleDB Hyperta

##### PostgreSQL Installation

Download the installation file (PostgreSQL 12.17 or newer releases) [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows) and follow the installation instructions.
Download the installation file (PostgreSQL 15 or newer releases) [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows) and follow the installation instructions.

During PostgreSQL installation, you will be prompted for superuser (postgres) password.
Don't forget this password. It will be used later. For simplicity, we will substitute it with "postgres".
Expand Down Expand Up @@ -50,7 +50,7 @@ spring:
username: "${SPRING_DATASOURCE_USERNAME:postgres}"
password: "${SPRING_DATASOURCE_PASSWORD:YOUR_POSTGRES_PASSWORD_HERE}"
hikari:
maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:5}"
maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:16}"
```
{: .copy-code}

Expand Down
4 changes: 2 additions & 2 deletions _includes/templates/install/windows-db-postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Many cloud vendors support managed PostgreSQL servers which is a cost-effective

##### PostgreSQL Installation

Download the installation file (PostgreSQL 12.17 or newer releases) [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows) and follow the installation instructions.
Download the installation file (PostgreSQL 15 or newer releases) [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows) and follow the installation instructions.

During PostgreSQL installation, you will be prompted for superuser (postgres) password.
Don't forget this password. It will be used later. For simplicity, we will substitute it with "postgres".
Expand Down Expand Up @@ -48,7 +48,7 @@ spring:
username: "${SPRING_DATASOURCE_USERNAME:postgres}"
password: "${SPRING_DATASOURCE_PASSWORD:YOUR_POSTGRES_PASSWORD_HERE}"
hikari:
maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:5}"
maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:16}"
```
{: .copy-code}

Expand Down
Loading

0 comments on commit 45f7203

Please sign in to comment.