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
3131cluster-slave-validity-factor 0
3232appendonly yes
3333requirepass ${redis_password}
34+ masterauth ${redis_password}
3435EOF
3536
3637# Configure Sentinel
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ cluster-node-timeout 5000
3232cluster-slave-validity-factor 0
3333appendonly yes
3434requirepass ${redis_password}
35+ masterauth ${redis_password}
3536EOF
3637
37-
3838sleep 30
3939# /usr/local/bin/redis-server $REDIS_CONFIG_FILE --daemonize yes
4040# 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