Skip to content

Commit 3e2d21f

Browse files
authored
Merge pull request #19 from pangpang20/master
Enhance High Availability and SSL Configuration for OpenGauss Cluster
2 parents 1d847dc + 370d1fd commit 3e2d21f

File tree

5 files changed

+1299
-27
lines changed

5 files changed

+1299
-27
lines changed

.github/workflows/tests-ssl.yml

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Create configuration directories
6060
run: |
6161
mkdir -p ${{ github.workspace }}/opengauss/conf
62-
sudo chown omm:omm ${{ github.workspace }}/opengauss/conf ${{ github.workspace }}/certs || true
62+
sudo chown omm:omm ${{ github.workspace }}/certs || true
6363
sudo chmod 755 ${{ github.workspace }}/opengauss/conf ${{ github.workspace }}/certs || true
6464
6565
- name: Set certificate permissions
@@ -70,7 +70,7 @@ jobs:
7070
7171
- name: Create postgresql.conf with SSL
7272
run: |
73-
sudo -u omm bash -c 'cat > ${{ github.workspace }}/opengauss/conf/postgresql.conf <<EOF
73+
sudo cat > ${{ github.workspace }}/opengauss/conf/postgresql.conf <<'EOF'
7474
max_connections = 200
7575
session_timeout = 10min
7676
bulk_write_ring_size = 2GB
@@ -81,63 +81,66 @@ jobs:
8181
enable_double_write = on
8282
wal_keep_segments = 16
8383
enable_slot_log = off
84-
synchronous_standby_names = '"'"'*'"'"'
84+
synchronous_standby_names = '*'
8585
walsender_max_send_size = 8MB
8686
hot_standby = on
8787
enable_kill_query = off
8888
logging_collector = on
89-
log_filename = '"'"'postgresql-%Y-%m-%d_%H%M%S.log'"'"'
89+
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
9090
log_file_mode = 0600
9191
log_rotation_size = 20MB
9292
log_min_duration_statement = 1800000
9393
log_connections = off
9494
log_disconnections = off
9595
log_duration = off
9696
log_hostname = off
97-
log_line_prefix = '"'"'%m %u %d %h %p %S '"'"'
98-
log_timezone = '"'"'UTC'"'"'
97+
log_line_prefix = '%m %u %d %h %p %S '
98+
log_timezone = 'UTC'
9999
enable_alarm = on
100100
connection_alarm_rate = 0.9
101101
alarm_report_interval = 10
102-
alarm_component = '"'"'/opt/snas/bin/snas_cm_cmd'"'"'
102+
alarm_component = '/opt/snas/bin/snas_cm_cmd'
103103
use_workload_manager = on
104-
datestyle = '"'"'iso, mdy'"'"'
105-
timezone = '"'"'UTC'"'"'
106-
lc_messages = '"'"'en_US.utf8'"'"'
107-
lc_monetary = '"'"'en_US.utf8'"'"'
108-
lc_numeric = '"'"'en_US.utf8'"'"'
109-
lc_time = '"'"'en_US.utf8'"'"'
110-
default_text_search_config = '"'"'pg_catalog.english'"'"'
104+
datestyle = 'iso, mdy'
105+
timezone = 'UTC'
106+
lc_messages = 'en_US.utf8'
107+
lc_monetary = 'en_US.utf8'
108+
lc_numeric = 'en_US.utf8'
109+
lc_time = 'en_US.utf8'
110+
default_text_search_config = 'pg_catalog.english'
111111
lockwait_timeout = 1200s
112-
pgxc_node_name = '"'"'gaussdb'"'"'
112+
pgxc_node_name = 'gaussdb'
113113
audit_enabled = on
114114
job_queue_processes = 10
115115
dolphin.nulls_minimal_policy = on
116116
password_encryption_type = 0
117117
wal_level = logical
118-
application_name = '"'"''"'"'
119-
listen_addresses = '"'"'*'"'"'
118+
application_name = ''
119+
listen_addresses = '*'
120120
max_replication_slots = 10
121121
max_wal_senders = 10
122122
shared_buffers = 512MB
123123
ssl = on
124-
ssl_cert_file = '"'"'/var/lib/opengauss/certs/server.crt'"'"'
125-
ssl_key_file = '"'"'/var/lib/opengauss/certs/server.key'"'"'
126-
ssl_ca_file = '"'"'/var/lib/opengauss/certs/ca.crt'"'"'
127-
EOF'
128-
sudo chmod 644 ${{ github.workspace }}/opengauss/conf/postgresql.conf
124+
ssl_cert_file = '/var/lib/opengauss/certs/server.crt'
125+
ssl_key_file = '/var/lib/opengauss/certs/server.key'
126+
ssl_ca_file = '/var/lib/opengauss/certs/ca.crt'
127+
EOF
129128
130129
- name: Create pg_hba.conf with SSL
131130
run: |
132-
sudo -u omm bash -c 'cat > ${{ github.workspace }}/opengauss/conf/pg_hba.conf <<EOF
131+
sudo cat >${{ github.workspace }}/opengauss/conf/pg_hba.conf <<'EOF'
133132
local all all trust
134133
host all all 127.0.0.1/32 trust
135134
host all all ::1/128 trust
136135
hostssl all all 0.0.0.0/0 cert
137-
host all all 0.0.0.0/0 md5
138-
host replication gaussdb 0.0.0.0/0 md5
139-
EOF'
140-
sudo chmod 644 ${{ github.workspace }}/opengauss/conf/pg_hba.conf
136+
host all all 0.0.0.0/0 md5
137+
host replication gaussdb 0.0.0.0/0 md5
138+
EOF
139+
140+
- name: Fix ownership
141+
run: |
142+
sudo chown -R omm:omm ${{ github.workspace }}/opengauss
143+
sudo chmod 644 ${{ github.workspace }}/opengauss/conf/*
141144
142145
- name: Debug file permissions
143146
run: |

0 commit comments

Comments
 (0)