Skip to content

Commit

Permalink
Configure logging in the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Feb 23, 2024
1 parent dfeebd0 commit 5294261
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions citus_dev/citus_dev
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ def createNodeCommands(clustername, role, port, arguments, index=None):
shared_preload_libraries = ','.join(shared_preload_libraries)

run(f"echo \"port = {port}\" >> {clustername}/{nodename}/postgresql.conf")
run(f"echo \"log_filename = '{nodename}_logfile'\" >> {clustername}/{nodename}/postgresql.conf")
run(f"echo \"logging_collector = 'on'\" >> {clustername}/{nodename}/postgresql.conf")
run(f"echo \"log_directory = '../..'\" >> {clustername}/{nodename}/postgresql.conf")
run(f"echo \"shared_preload_libraries = '{shared_preload_libraries}'\" >> {clustername}/{nodename}/postgresql.conf")
run(f'echo "wal_level = logical" >> {clustername}/{nodename}/postgresql.conf')
run(f'echo "citus.enable_create_database_propagation = true" >> {clustername}/{nodename}/postgresql.conf')
if not arguments['--fsync']:
run(f'echo "fsync = false" >> {clustername}/{nodename}/postgresql.conf')

Expand Down Expand Up @@ -147,11 +151,11 @@ def main(arguments):
createPgBouncerConfig(clustername, port, i)

role = "coordinator"
run(f'pg_ctl {pgctl_flags} -D {clustername}/{role} -l {role}_logfile start')
run(f'pg_ctl {pgctl_flags} -D {clustername}/{role} start')

for i in range(size):
role = "worker%d" % i
run(f'pg_ctl {pgctl_flags} start -D {clustername}/{role} -l {role}_logfile')
run(f'pg_ctl {pgctl_flags} start -D {clustername}/{role}')
port = cport

if getpass.getuser() != 'postgres' and not os.getenv('PGDATABASE'):
Expand Down Expand Up @@ -198,7 +202,7 @@ def main(arguments):
clustername = arguments["<name>"]
port = int(arguments["--port"])
for role in getRoles(clustername):
run(f'pg_ctl {pgctl_flags} start -D {clustername}/{role} -o "-p {port}" -l {role}_logfile')
run(f'pg_ctl {pgctl_flags} start -D {clustername}/{role} -o "-p {port}"')
port += 1
for bouncerConfig in getPgBouncerConfigs(clustername):
run(f'pgbouncer -d {clustername}/{bouncerConfig}')
Expand Down

0 comments on commit 5294261

Please sign in to comment.