renamed env variables and docker related items from redis to valkey
This commit is contained in:
parent
456e32abd0
commit
a49f8a6d67
@ -19,11 +19,11 @@ In order to set database type change the value of `DATABASE` variable in `.env`
|
|||||||
|
|
||||||
In order to set cache type change the value of `CACHE` variable in `.env` file to one of the following:
|
In order to set cache type change the value of `CACHE` variable in `.env` file to one of the following:
|
||||||
|
|
||||||
- `redis` - use Redis standalone cache (1 node - 1 master);
|
- `valkey` - use Valkey standalone cache (1 node - 1 primary);
|
||||||
- `redis-cluster` - use Redis cluster cache (6 nodes - 3 masters, 3 slaves);
|
- `valkey-cluster` - use Valkey cluster cache (6 nodes - 3 primaries, 3 replicas);
|
||||||
- `redis-sentinel` - use Redis sentinel cache (3 nodes - 1 master, 1 slave, 1 sentinel)
|
- `valkey-sentinel` - use Valkey sentinel cache (3 nodes - 1 primary, 1 replica, 1 sentinel)
|
||||||
|
|
||||||
**NOTE**: According to the cache type corresponding docker service will be deployed (see `docker-compose.redis.yml`, `docker-compose.redis-cluster.yml`, `docker-compose.redis-sentinel.yml` for details).
|
**NOTE**: According to the cache type corresponding docker service will be deployed (see `docker-compose.valkey.yml`, `docker-compose.valkey-cluster.yml`, `docker-compose.valkey-sentinel.yml` for details).
|
||||||
|
|
||||||
Execute the following command to create log folders for the services and chown of these folders to the docker container users.
|
Execute the following command to create log folders for the services and chown of these folders to the docker container users.
|
||||||
To be able to change user, **chown** command is used, which requires sudo permissions (script will request password for a sudo access):
|
To be able to change user, **chown** command is used, which requires sudo permissions (script will request password for a sudo access):
|
||||||
|
|||||||
@ -31,10 +31,10 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
valkey-sentinel-data-primary:
|
valkey-sentinel-data-primary:
|
||||||
external:
|
external:
|
||||||
name: ${VALKEY_SENTINEL_DATA_VOLUME_MASTER}
|
name: ${VALKEY_SENTINEL_DATA_VOLUME_PRIMARY}
|
||||||
valkey-sentinel-data-replica:
|
valkey-sentinel-data-replica:
|
||||||
external:
|
external:
|
||||||
name: ${VALKEY_SENTINEL_DATA_VOLUME_SLAVE}
|
name: ${VALKEY_SENTINEL_DATA_VOLUME_REPLICA}
|
||||||
valkey-sentinel-data-sentinel:
|
valkey-sentinel-data-sentinel:
|
||||||
external:
|
external:
|
||||||
name: ${VALKEY_SENTINEL_DATA_VOLUME_SENTINEL}
|
name: ${VALKEY_SENTINEL_DATA_VOLUME_SENTINEL}
|
||||||
|
|||||||
@ -18,19 +18,19 @@ As result, in REPOSITORY column, next images should be present:
|
|||||||
thingsboard/tb-web-ui
|
thingsboard/tb-web-ui
|
||||||
thingsboard/tb-js-executor
|
thingsboard/tb-js-executor
|
||||||
|
|
||||||
- Run the black box tests (without ui tests) in the [msa/black-box-tests](../black-box-tests) directory with Redis standalone:
|
- Run the black box tests (without ui tests) in the [msa/black-box-tests](../black-box-tests) directory with Valkey standalone:
|
||||||
|
|
||||||
mvn clean install -DblackBoxTests.skip=false
|
mvn clean install -DblackBoxTests.skip=false
|
||||||
|
|
||||||
- Run the black box tests (without ui tests) in the [msa/black-box-tests](../black-box-tests) directory with Redis standalone with TLS:
|
- Run the black box tests (without ui tests) in the [msa/black-box-tests](../black-box-tests) directory with Valkey standalone with TLS:
|
||||||
|
|
||||||
mvn clean install -DblackBoxTests.skip=false -DblackBoxTests.redisSsl=true
|
mvn clean install -DblackBoxTests.skip=false -DblackBoxTests.redisSsl=true
|
||||||
|
|
||||||
- Run the black box tests in the [msa/black-box-tests](../black-box-tests) directory with Redis cluster:
|
- Run the black box tests in the [msa/black-box-tests](../black-box-tests) directory with the Valkey cluster:
|
||||||
|
|
||||||
mvn clean install -DblackBoxTests.skip=false -DblackBoxTests.redisCluster=true
|
mvn clean install -DblackBoxTests.skip=false -DblackBoxTests.redisCluster=true
|
||||||
|
|
||||||
- Run the black box tests in the [msa/black-box-tests](../black-box-tests) directory with Redis sentinel:
|
- Run the black box tests in the [msa/black-box-tests](../black-box-tests) directory with Valkey sentinel:
|
||||||
|
|
||||||
mvn clean install -DblackBoxTests.skip=false -DblackBoxTests.redisSentinel=true
|
mvn clean install -DblackBoxTests.skip=false -DblackBoxTests.redisSentinel=true
|
||||||
|
|
||||||
|
|||||||
@ -42,9 +42,9 @@ import static org.testng.Assert.fail;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ContainerTestSuite {
|
public class ContainerTestSuite {
|
||||||
final static boolean IS_REDIS_CLUSTER = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisCluster"));
|
final static boolean IS_VALKEY_CLUSTER = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisCluster"));
|
||||||
final static boolean IS_REDIS_SENTINEL = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisSentinel"));
|
final static boolean IS_VALKEY_SENTINEL = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisSentinel"));
|
||||||
final static boolean IS_REDIS_SSL = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisSsl"));
|
final static boolean IS_VALKEY_SSL = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisSsl"));
|
||||||
final static boolean IS_HYBRID_MODE = Boolean.parseBoolean(System.getProperty("blackBoxTests.hybridMode"));
|
final static boolean IS_HYBRID_MODE = Boolean.parseBoolean(System.getProperty("blackBoxTests.hybridMode"));
|
||||||
final static String QUEUE_TYPE = System.getProperty("blackBoxTests.queue", "kafka");
|
final static String QUEUE_TYPE = System.getProperty("blackBoxTests.queue", "kafka");
|
||||||
private static final String SOURCE_DIR = "./../../docker/";
|
private static final String SOURCE_DIR = "./../../docker/";
|
||||||
@ -82,9 +82,9 @@ public class ContainerTestSuite {
|
|||||||
public void start() {
|
public void start() {
|
||||||
installTb = new ThingsBoardDbInstaller();
|
installTb = new ThingsBoardDbInstaller();
|
||||||
installTb.createVolumes();
|
installTb.createVolumes();
|
||||||
log.info("System property of blackBoxTests.redisCluster is {}", IS_REDIS_CLUSTER);
|
log.info("System property of blackBoxTests.redisCluster is {}", IS_VALKEY_CLUSTER);
|
||||||
log.info("System property of blackBoxTests.redisSentinel is {}", IS_REDIS_SENTINEL);
|
log.info("System property of blackBoxTests.redisSentinel is {}", IS_VALKEY_SENTINEL);
|
||||||
log.info("System property of blackBoxTests.redisSsl is {}", IS_REDIS_SSL);
|
log.info("System property of blackBoxTests.redisSsl is {}", IS_VALKEY_SSL);
|
||||||
log.info("System property of blackBoxTests.hybridMode is {}", IS_HYBRID_MODE);
|
log.info("System property of blackBoxTests.hybridMode is {}", IS_HYBRID_MODE);
|
||||||
boolean skipTailChildContainers = Boolean.parseBoolean(System.getProperty("blackBoxTests.skipTailChildContainers"));
|
boolean skipTailChildContainers = Boolean.parseBoolean(System.getProperty("blackBoxTests.skipTailChildContainers"));
|
||||||
try {
|
try {
|
||||||
@ -107,10 +107,10 @@ public class ContainerTestSuite {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_REDIS_SSL) {
|
if (IS_VALKEY_SSL) {
|
||||||
addToFile(targetDir, "cache-redis.env",
|
addToFile(targetDir, "cache-valkey.env",
|
||||||
Map.of("TB_REDIS_SSL_ENABLED", "true",
|
Map.of("TB_REDIS_SSL_ENABLED", "true",
|
||||||
"TB_REDIS_SSL_PEM_CERT", "/redis/certs/redisCA.crt"));
|
"TB_REDIS_SSL_PEM_CERT", "/valkey/certs/valkeyCA.crt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<File> composeFiles = new ArrayList<>(Arrays.asList(
|
List<File> composeFiles = new ArrayList<>(Arrays.asList(
|
||||||
@ -123,8 +123,8 @@ public class ContainerTestSuite {
|
|||||||
new File(targetDir + (IS_HYBRID_MODE ? "docker-compose.hybrid-test-extras.yml" : "docker-compose.postgres-test-extras.yml")),
|
new File(targetDir + (IS_HYBRID_MODE ? "docker-compose.hybrid-test-extras.yml" : "docker-compose.postgres-test-extras.yml")),
|
||||||
new File(targetDir + "docker-compose.postgres.volumes.yml"),
|
new File(targetDir + "docker-compose.postgres.volumes.yml"),
|
||||||
new File(targetDir + "docker-compose." + QUEUE_TYPE + ".yml"),
|
new File(targetDir + "docker-compose." + QUEUE_TYPE + ".yml"),
|
||||||
new File(targetDir + resolveRedisComposeFile()),
|
new File(targetDir + resolveValkeyComposeFile()),
|
||||||
new File(targetDir + resolveRedisComposeVolumesFile()),
|
new File(targetDir + resolveValkeyComposeVolumesFile()),
|
||||||
new File(targetDir + ("docker-selenium.yml"))
|
new File(targetDir + ("docker-selenium.yml"))
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -198,30 +198,30 @@ public class ContainerTestSuite {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String resolveRedisComposeFile() {
|
private static String resolveValkeyComposeFile() {
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
return "docker-compose.redis-cluster.yml";
|
return "docker-compose.valkey-cluster.yml";
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SENTINEL) {
|
if (IS_VALKEY_SENTINEL) {
|
||||||
return "docker-compose.redis-sentinel.yml";
|
return "docker-compose.valkey-sentinel.yml";
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SSL) {
|
if (IS_VALKEY_SSL) {
|
||||||
return "docker-compose.redis-ssl.yml";
|
return "docker-compose.valkey-ssl.yml";
|
||||||
}
|
}
|
||||||
return "docker-compose.redis.yml";
|
return "docker-compose.valkey.yml";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String resolveRedisComposeVolumesFile() {
|
private static String resolveValkeyComposeVolumesFile() {
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
return "docker-compose.redis-cluster.volumes.yml";
|
return "docker-compose.valkey-cluster.volumes.yml";
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SENTINEL) {
|
if (IS_VALKEY_SENTINEL) {
|
||||||
return "docker-compose.redis-sentinel.volumes.yml";
|
return "docker-compose.valkey-sentinel.volumes.yml";
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SSL) {
|
if (IS_VALKEY_SSL) {
|
||||||
return "docker-compose.redis-ssl.volumes.yml";
|
return "docker-compose.valkey-ssl.volumes.yml";
|
||||||
}
|
}
|
||||||
return "docker-compose.redis.volumes.yml";
|
return "docker-compose.valkey.volumes.yml";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
|
|||||||
@ -32,15 +32,15 @@ import java.util.stream.IntStream;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class ThingsBoardDbInstaller {
|
public class ThingsBoardDbInstaller {
|
||||||
|
|
||||||
final static boolean IS_REDIS_CLUSTER = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisCluster"));
|
final static boolean IS_VALKEY_CLUSTER = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisCluster"));
|
||||||
final static boolean IS_REDIS_SENTINEL = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisSentinel"));
|
final static boolean IS_VALKEY_SENTINEL = Boolean.parseBoolean(System.getProperty("blackBoxTests.redisSentinel"));
|
||||||
final static boolean IS_HYBRID_MODE = Boolean.parseBoolean(System.getProperty("blackBoxTests.hybridMode"));
|
final static boolean IS_HYBRID_MODE = Boolean.parseBoolean(System.getProperty("blackBoxTests.hybridMode"));
|
||||||
private final static String POSTGRES_DATA_VOLUME = "tb-postgres-test-data-volume";
|
private final static String POSTGRES_DATA_VOLUME = "tb-postgres-test-data-volume";
|
||||||
|
|
||||||
private final static String CASSANDRA_DATA_VOLUME = "tb-cassandra-test-data-volume";
|
private final static String CASSANDRA_DATA_VOLUME = "tb-cassandra-test-data-volume";
|
||||||
private final static String REDIS_DATA_VOLUME = "tb-redis-data-volume";
|
private final static String VALKEY_DATA_VOLUME = "tb-valkey-data-volume";
|
||||||
private final static String REDIS_CLUSTER_DATA_VOLUME = "tb-redis-cluster-data-volume";
|
private final static String VALKEY_CLUSTER_DATA_VOLUME = "tb-valkey-cluster-data-volume";
|
||||||
private final static String REDIS_SENTINEL_DATA_VOLUME = "tb-redis-sentinel-data-volume";
|
private final static String VALKEY_SENTINEL_DATA_VOLUME = "tb-valkey-sentinel-data-volume";
|
||||||
private final static String TB_LOG_VOLUME = "tb-log-test-volume";
|
private final static String TB_LOG_VOLUME = "tb-log-test-volume";
|
||||||
private final static String TB_COAP_TRANSPORT_LOG_VOLUME = "tb-coap-transport-log-test-volume";
|
private final static String TB_COAP_TRANSPORT_LOG_VOLUME = "tb-coap-transport-log-test-volume";
|
||||||
private final static String TB_LWM2M_TRANSPORT_LOG_VOLUME = "tb-lwm2m-transport-log-test-volume";
|
private final static String TB_LWM2M_TRANSPORT_LOG_VOLUME = "tb-lwm2m-transport-log-test-volume";
|
||||||
@ -56,9 +56,9 @@ public class ThingsBoardDbInstaller {
|
|||||||
private final String postgresDataVolume;
|
private final String postgresDataVolume;
|
||||||
private final String cassandraDataVolume;
|
private final String cassandraDataVolume;
|
||||||
|
|
||||||
private final String redisDataVolume;
|
private final String valkeyDataVolume;
|
||||||
private final String redisClusterDataVolume;
|
private final String valkeyClusterDataVolume;
|
||||||
private final String redisSentinelDataVolume;
|
private final String valkeySentinelDataVolume;
|
||||||
private final String tbLogVolume;
|
private final String tbLogVolume;
|
||||||
private final String tbCoapTransportLogVolume;
|
private final String tbCoapTransportLogVolume;
|
||||||
private final String tbLwm2mTransportLogVolume;
|
private final String tbLwm2mTransportLogVolume;
|
||||||
@ -70,8 +70,8 @@ public class ThingsBoardDbInstaller {
|
|||||||
private final Map<String, String> env;
|
private final Map<String, String> env;
|
||||||
|
|
||||||
public ThingsBoardDbInstaller() {
|
public ThingsBoardDbInstaller() {
|
||||||
log.info("System property of blackBoxTests.redisCluster is {}", IS_REDIS_CLUSTER);
|
log.info("System property of blackBoxTests.redisCluster is {}", IS_VALKEY_CLUSTER);
|
||||||
log.info("System property of blackBoxTests.redisCluster is {}", IS_REDIS_SENTINEL);
|
log.info("System property of blackBoxTests.redisCluster is {}", IS_VALKEY_SENTINEL);
|
||||||
log.info("System property of blackBoxTests.hybridMode is {}", IS_HYBRID_MODE);
|
log.info("System property of blackBoxTests.hybridMode is {}", IS_HYBRID_MODE);
|
||||||
List<File> composeFiles = new ArrayList<>(Arrays.asList(
|
List<File> composeFiles = new ArrayList<>(Arrays.asList(
|
||||||
new File("./../../docker/docker-compose.yml"),
|
new File("./../../docker/docker-compose.yml"),
|
||||||
@ -80,8 +80,8 @@ public class ThingsBoardDbInstaller {
|
|||||||
? new File("./../../docker/docker-compose.hybrid.yml")
|
? new File("./../../docker/docker-compose.hybrid.yml")
|
||||||
: new File("./../../docker/docker-compose.postgres.yml"),
|
: new File("./../../docker/docker-compose.postgres.yml"),
|
||||||
new File("./../../docker/docker-compose.postgres.volumes.yml"),
|
new File("./../../docker/docker-compose.postgres.volumes.yml"),
|
||||||
resolveRedisComposeFile(),
|
resolveValkeyComposeFile(),
|
||||||
resolveRedisComposeVolumesFile()
|
resolveValkeyComposeVolumesFile()
|
||||||
));
|
));
|
||||||
if (IS_HYBRID_MODE) {
|
if (IS_HYBRID_MODE) {
|
||||||
composeFiles.add(new File("./../../docker/docker-compose.cassandra.volumes.yml"));
|
composeFiles.add(new File("./../../docker/docker-compose.cassandra.volumes.yml"));
|
||||||
@ -95,9 +95,9 @@ public class ThingsBoardDbInstaller {
|
|||||||
|
|
||||||
postgresDataVolume = project + "_" + POSTGRES_DATA_VOLUME;
|
postgresDataVolume = project + "_" + POSTGRES_DATA_VOLUME;
|
||||||
cassandraDataVolume = project + "_" + CASSANDRA_DATA_VOLUME;
|
cassandraDataVolume = project + "_" + CASSANDRA_DATA_VOLUME;
|
||||||
redisDataVolume = project + "_" + REDIS_DATA_VOLUME;
|
valkeyDataVolume = project + "_" + VALKEY_DATA_VOLUME;
|
||||||
redisClusterDataVolume = project + "_" + REDIS_CLUSTER_DATA_VOLUME;
|
valkeyClusterDataVolume = project + "_" + VALKEY_CLUSTER_DATA_VOLUME;
|
||||||
redisSentinelDataVolume = project + "_" + REDIS_SENTINEL_DATA_VOLUME;
|
valkeySentinelDataVolume = project + "_" + VALKEY_SENTINEL_DATA_VOLUME;
|
||||||
tbLogVolume = project + "_" + TB_LOG_VOLUME;
|
tbLogVolume = project + "_" + TB_LOG_VOLUME;
|
||||||
tbCoapTransportLogVolume = project + "_" + TB_COAP_TRANSPORT_LOG_VOLUME;
|
tbCoapTransportLogVolume = project + "_" + TB_COAP_TRANSPORT_LOG_VOLUME;
|
||||||
tbLwm2mTransportLogVolume = project + "_" + TB_LWM2M_TRANSPORT_LOG_VOLUME;
|
tbLwm2mTransportLogVolume = project + "_" + TB_LWM2M_TRANSPORT_LOG_VOLUME;
|
||||||
@ -123,38 +123,38 @@ public class ThingsBoardDbInstaller {
|
|||||||
env.put("TB_SNMP_TRANSPORT_LOG_VOLUME", tbSnmpTransportLogVolume);
|
env.put("TB_SNMP_TRANSPORT_LOG_VOLUME", tbSnmpTransportLogVolume);
|
||||||
env.put("TB_VC_EXECUTOR_LOG_VOLUME", tbVcExecutorLogVolume);
|
env.put("TB_VC_EXECUTOR_LOG_VOLUME", tbVcExecutorLogVolume);
|
||||||
env.put("TB_EDQS_LOG_VOLUME", tbEdqsLogVolume);
|
env.put("TB_EDQS_LOG_VOLUME", tbEdqsLogVolume);
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
env.put("REDIS_CLUSTER_DATA_VOLUME_" + i, redisClusterDataVolume + '-' + i);
|
env.put("VALKEY_CLUSTER_DATA_VOLUME_" + i, valkeyClusterDataVolume + '-' + i);
|
||||||
}
|
}
|
||||||
} else if (IS_REDIS_SENTINEL) {
|
} else if (IS_VALKEY_SENTINEL) {
|
||||||
env.put("REDIS_SENTINEL_DATA_VOLUME_MASTER", redisSentinelDataVolume + "-" + "master");
|
env.put("VALKEY_SENTINEL_DATA_VOLUME_PRIMARY", valkeySentinelDataVolume + "-" + "primary");
|
||||||
env.put("REDIS_SENTINEL_DATA_VOLUME_SLAVE", redisSentinelDataVolume + "-" + "slave");
|
env.put("VALKEY_SENTINEL_DATA_VOLUME_REPLICA", valkeySentinelDataVolume + "-" + "replica");
|
||||||
env.put("REDIS_SENTINEL_DATA_VOLUME_SENTINEL", redisSentinelDataVolume + "-" + "sentinel");
|
env.put("VALKEY_SENTINEL_DATA_VOLUME_SENTINEL", valkeySentinelDataVolume + "-" + "sentinel");
|
||||||
} else {
|
} else {
|
||||||
env.put("REDIS_DATA_VOLUME", redisDataVolume);
|
env.put("VALKEY_DATA_VOLUME", valkeyDataVolume);
|
||||||
}
|
}
|
||||||
dockerCompose.withEnv(env);
|
dockerCompose.withEnv(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File resolveRedisComposeVolumesFile() {
|
private static File resolveValkeyComposeVolumesFile() {
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
return new File("./../../docker/docker-compose.redis-cluster.volumes.yml");
|
return new File("./../../docker/docker-compose.valkey-cluster.volumes.yml");
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SENTINEL) {
|
if (IS_VALKEY_SENTINEL) {
|
||||||
return new File("./../../docker/docker-compose.redis-sentinel.volumes.yml");
|
return new File("./../../docker/docker-compose.valkey-sentinel.volumes.yml");
|
||||||
}
|
}
|
||||||
return new File("./../../docker/docker-compose.redis.volumes.yml");
|
return new File("./../../docker/docker-compose.valkey.volumes.yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File resolveRedisComposeFile() {
|
private static File resolveValkeyComposeFile() {
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
return new File("./../../docker/docker-compose.redis-cluster.yml");
|
return new File("./../../docker/docker-compose.valkey-cluster.yml");
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SENTINEL) {
|
if (IS_VALKEY_SENTINEL) {
|
||||||
return new File("./../../docker/docker-compose.redis-sentinel.yml");
|
return new File("./../../docker/docker-compose.valkey-sentinel.yml");
|
||||||
}
|
}
|
||||||
return new File("./../../docker/docker-compose.redis.yml");
|
return new File("./../../docker/docker-compose.valkey.yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getEnv() {
|
public Map<String, String> getEnv() {
|
||||||
@ -200,27 +200,27 @@ public class ThingsBoardDbInstaller {
|
|||||||
if (IS_HYBRID_MODE) {
|
if (IS_HYBRID_MODE) {
|
||||||
additionalServices.append(" cassandra");
|
additionalServices.append(" cassandra");
|
||||||
}
|
}
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
additionalServices.append(" redis-node-").append(i);
|
additionalServices.append(" valkey-node-").append(i);
|
||||||
dockerCompose.withCommand("volume create " + redisClusterDataVolume + '-' + i);
|
dockerCompose.withCommand("volume create " + valkeyClusterDataVolume + '-' + i);
|
||||||
dockerCompose.invokeDocker();
|
dockerCompose.invokeDocker();
|
||||||
}
|
}
|
||||||
} else if (IS_REDIS_SENTINEL) {
|
} else if (IS_VALKEY_SENTINEL) {
|
||||||
additionalServices.append(" redis-master");
|
additionalServices.append(" valkey-primary");
|
||||||
dockerCompose.withCommand("volume create " + redisSentinelDataVolume + "-" + "master");
|
dockerCompose.withCommand("volume create " + valkeySentinelDataVolume + "-" + "primary");
|
||||||
dockerCompose.invokeDocker();
|
dockerCompose.invokeDocker();
|
||||||
|
|
||||||
additionalServices.append(" redis-slave");
|
additionalServices.append(" valkey-replica");
|
||||||
dockerCompose.withCommand("volume create " + redisSentinelDataVolume + '-' + "slave");
|
dockerCompose.withCommand("volume create " + valkeySentinelDataVolume + '-' + "replica");
|
||||||
dockerCompose.invokeDocker();
|
dockerCompose.invokeDocker();
|
||||||
|
|
||||||
additionalServices.append(" redis-sentinel");
|
additionalServices.append(" valkey-sentinel");
|
||||||
dockerCompose.withCommand("volume create " + redisSentinelDataVolume + '-' + "sentinel");
|
dockerCompose.withCommand("volume create " + valkeySentinelDataVolume + '-' + "sentinel");
|
||||||
dockerCompose.invokeDocker();
|
dockerCompose.invokeDocker();
|
||||||
} else {
|
} else {
|
||||||
additionalServices.append(" redis");
|
additionalServices.append(" valkey");
|
||||||
dockerCompose.withCommand("volume create " + redisDataVolume);
|
dockerCompose.withCommand("volume create " + valkeyDataVolume);
|
||||||
dockerCompose.invokeDocker();
|
dockerCompose.invokeDocker();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ public class ThingsBoardDbInstaller {
|
|||||||
.add(tbSnmpTransportLogVolume)
|
.add(tbSnmpTransportLogVolume)
|
||||||
.add(tbVcExecutorLogVolume)
|
.add(tbVcExecutorLogVolume)
|
||||||
.add(tbEdqsLogVolume)
|
.add(tbEdqsLogVolume)
|
||||||
.add(resolveRedisComposeVolumeLog());
|
.add(resolveValkeyComposeVolumeLog());
|
||||||
|
|
||||||
if (IS_HYBRID_MODE) {
|
if (IS_HYBRID_MODE) {
|
||||||
rmVolumesCommand.add(cassandraDataVolume);
|
rmVolumesCommand.add(cassandraDataVolume);
|
||||||
@ -270,16 +270,16 @@ public class ThingsBoardDbInstaller {
|
|||||||
dockerCompose.withCommand(rmVolumesCommand.toString());
|
dockerCompose.withCommand(rmVolumesCommand.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String resolveRedisComposeVolumeLog() {
|
private String resolveValkeyComposeVolumeLog() {
|
||||||
if (IS_REDIS_CLUSTER) {
|
if (IS_VALKEY_CLUSTER) {
|
||||||
return IntStream.range(0, 6).mapToObj(i -> " " + redisClusterDataVolume + "-" + i).collect(Collectors.joining());
|
return IntStream.range(0, 6).mapToObj(i -> " " + valkeyClusterDataVolume + "-" + i).collect(Collectors.joining());
|
||||||
}
|
}
|
||||||
if (IS_REDIS_SENTINEL) {
|
if (IS_VALKEY_SENTINEL) {
|
||||||
return redisSentinelDataVolume + "-" + "master " + " " +
|
return valkeySentinelDataVolume + "-" + "primary " + " " +
|
||||||
redisSentinelDataVolume + "-" + "slave" + " " +
|
valkeySentinelDataVolume + "-" + "replica" + " " +
|
||||||
redisSentinelDataVolume + " " + "sentinel";
|
valkeySentinelDataVolume + " " + "sentinel";
|
||||||
}
|
}
|
||||||
return redisDataVolume;
|
return valkeyDataVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyLogs(String volumeName, String targetDir) {
|
private void copyLogs(String volumeName, String targetDir) {
|
||||||
|
|||||||
@ -17,11 +17,11 @@
|
|||||||
version: '3.0'
|
version: '3.0'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
redis:
|
valkey:
|
||||||
volumes:
|
volumes:
|
||||||
- redis-data:/bitnami/redis/data
|
- valkey-data:/bitnami/valkey/data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
redis-data:
|
valkey-data:
|
||||||
external:
|
external:
|
||||||
name: ${REDIS_DATA_VOLUME}
|
name: ${VALKEY_DATA_VOLUME}
|
||||||
@ -17,114 +17,114 @@
|
|||||||
version: '3.0'
|
version: '3.0'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# Redis standalone
|
# Valkey standalone
|
||||||
# The latest version of Redis compatible with ThingsBoard is 7.2
|
# The latest version of Valkey compatible with ThingsBoard is 8.0
|
||||||
redis:
|
valkey:
|
||||||
restart: always
|
restart: always
|
||||||
image: bitnami/valkey:8.0
|
image: bitnami/valkey:8.0
|
||||||
environment:
|
environment:
|
||||||
# ALLOW_EMPTY_PASSWORD is recommended only for development.
|
# ALLOW_EMPTY_PASSWORD is recommended only for development.
|
||||||
- 'ALLOW_EMPTY_PASSWORD=yes'
|
- 'ALLOW_EMPTY_PASSWORD=yes'
|
||||||
- 'VALKEY_TLS_ENABLED=yes'
|
- 'VALKEY_TLS_ENABLED=yes'
|
||||||
- 'VALKEY_TLS_CERT_FILE=/redis/certs/redis.crt'
|
- 'VALKEY_TLS_CERT_FILE=/valkey/certs/valkey.crt'
|
||||||
- 'VALKEY_TLS_KEY_FILE=/redis/certs/redis.key'
|
- 'VALKEY_TLS_KEY_FILE=/valkey/certs/valkey.key'
|
||||||
- 'VALKEY_TLS_CA_FILE=/redis/certs/redisCA.crt'
|
- 'VALKEY_TLS_CA_FILE=/valkey/certs/valkeyCA.crt'
|
||||||
- 'VALKEY_TLS_AUTH_CLIENTS=no'
|
- 'VALKEY_TLS_AUTH_CLIENTS=no'
|
||||||
ports:
|
ports:
|
||||||
- '6379:6379'
|
- '6379:6379'
|
||||||
volumes:
|
volumes:
|
||||||
- ./tb-node/redis-data:/bitnami/redis/data
|
- ./tb-node/valkey-data:/bitnami/valkey/data
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
|
|
||||||
# ThingsBoard setup to use redis-standalone
|
# ThingsBoard setup to use valkey-standalone
|
||||||
tb-core1:
|
tb-core1:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-core2:
|
tb-core2:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-rule-engine1:
|
tb-rule-engine1:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-rule-engine2:
|
tb-rule-engine2:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-mqtt-transport1:
|
tb-mqtt-transport1:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-mqtt-transport2:
|
tb-mqtt-transport2:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-http-transport1:
|
tb-http-transport1:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-http-transport2:
|
tb-http-transport2:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-coap-transport:
|
tb-coap-transport:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-lwm2m-transport:
|
tb-lwm2m-transport:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-snmp-transport:
|
tb-snmp-transport:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-vc-executor1:
|
tb-vc-executor1:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
tb-vc-executor2:
|
tb-vc-executor2:
|
||||||
env_file:
|
env_file:
|
||||||
- cache-redis.env
|
- cache-valkey.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-certs:/redis/certs
|
- ./valkey-certs:/valkey/certs
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- valkey
|
||||||
Loading…
x
Reference in New Issue
Block a user