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 Mar 15, 2024
1 parent 7f8c6ee commit d10eb8a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions citus_dev/citus_dev
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ 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')
if not arguments['--fsync']:
Expand Down Expand Up @@ -149,11 +152,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 @@ -200,7 +203,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} -l {role}_logfile')
run(f'pg_ctl {pgctl_flags} start -D {clustername}/{role}')
port += 1
for bouncerConfig in getPgBouncerConfigs(clustername):
run(f'pgbouncer -d {clustername}/{bouncerConfig}')
Expand All @@ -217,7 +220,7 @@ def main(arguments):

else:
for role in getRoles(clustername):
run(f'pg_ctl {pgctl_flags} restart -D {clustername}/{role} -l {role}_logfile')
run(f'pg_ctl {pgctl_flags} restart -D {clustername}/{role}')


else:
Expand Down

0 comments on commit d10eb8a

Please sign in to comment.