File tree Expand file tree Collapse file tree 4 files changed +75
-1
lines changed Expand file tree Collapse file tree 4 files changed +75
-1
lines changed Original file line number Diff line number Diff line change
1
+ resource "random_id" "dynamic_group" {
2
+ byte_length = 2
3
+ }
4
+
5
+ resource "oci_identity_dynamic_group" "redis_dynamic_group" {
6
+
7
+ provider = oci. homeregion
8
+
9
+ compartment_id = var. tenancy_ocid
10
+
11
+ name = " redis-cluster-dynamic-group-${ random_id . dynamic_group . hex } "
12
+ description = " Dynamic group of Redis cluster Compute instances"
13
+
14
+ matching_rule = " tag.${ oci_identity_tag_namespace . ArchitectureCenterTagNamespace . name } .${ oci_identity_tag . ArchitectureCenterTag . name } .value = '${ var . release } '"
15
+ }
Original file line number Diff line number Diff line change
1
+ resource "oci_logging_log_group" "redis_log_group" {
2
+
3
+ compartment_id = var. compartment_ocid
4
+ display_name = " Redis Log Group"
5
+ }
6
+
7
+ resource "oci_logging_log" "redis_log" {
8
+
9
+ display_name = " Redis Logs"
10
+
11
+ is_enabled = true
12
+ log_group_id = oci_logging_log_group. redis_log_group . id
13
+ log_type = " CUSTOM"
14
+ retention_duration = " 30"
15
+ }
16
+
17
+ resource "oci_logging_unified_agent_configuration" "redis_log_agent_config" {
18
+
19
+ compartment_id = var. compartment_ocid
20
+
21
+ description = " Log Agent configuration for Redis nodes"
22
+ display_name = " redis-log-agent-config"
23
+
24
+ group_association {
25
+ group_list = [
26
+ oci_identity_dynamic_group . redis_dynamic_group . id
27
+ ]
28
+ }
29
+
30
+ is_enabled = true
31
+
32
+ service_configuration {
33
+
34
+ configuration_type = " LOGGING"
35
+
36
+ destination {
37
+ log_object_id = oci_logging_log. redis_log . id
38
+ }
39
+
40
+ sources {
41
+
42
+ name = " redis_server"
43
+
44
+ parser {
45
+
46
+ parser_type = " REGEXP"
47
+ expression = " ^(?<pid>\\ d+):(?<role>[XCSM]) (?<time>[^\\ ]]*) (?<level>[\\ .\\ -\\ *\\ #]) (?<message>.+)$"
48
+ time_format = " %d %B %Y %H:%M:%S.%L"
49
+ }
50
+
51
+ paths = [
52
+ " /tmp/redis-server.log"
53
+ ]
54
+
55
+ source_type = " LOG_TAIL"
56
+ }
57
+ }
58
+ }
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ cluster-node-timeout 5000
31
31
cluster-slave-validity-factor 0
32
32
appendonly yes
33
33
requirepass ${redis_password}
34
+ masterauth ${redis_password}
34
35
EOF
35
36
36
37
# Configure Sentinel
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ cluster-node-timeout 5000
32
32
cluster-slave-validity-factor 0
33
33
appendonly yes
34
34
requirepass ${redis_password}
35
+ masterauth ${redis_password}
35
36
EOF
36
37
37
-
38
38
sleep 30
39
39
# /usr/local/bin/redis-server $REDIS_CONFIG_FILE --daemonize yes
40
40
# nohup /usr/local/bin/redis-server $REDIS_CONFIG_FILE > /tmp/redis-server.log &
You can’t perform that action at this time.
0 commit comments