-
Notifications
You must be signed in to change notification settings - Fork 549
Use Postgresql as an alternative storage for job history #4164
Conversation
30ef3a8
to
6bf6184
Compare
8323ae1
to
7451a1c
Compare
<format> | ||
@type json | ||
</format> | ||
</filter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remote it? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this log makes my debugging harder since fc-objectsnapshots
is very huge, which makes other userful logs difficult to see. If it is necessary, I can revert this change. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so let's just comment it out,
In reply to: 391375514 [](ancestors = 391375514)
OK, done. #Closed
@@ -143,4 +135,26 @@ data: | |||
overflow_action block | |||
</buffer> | |||
</store> | |||
{% if (cluster_cfg['internal-storage']['enable']) and (cluster_cfg['postgresql']['enable']) %} | |||
<store> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also and IF for elasticsearch? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done #Closed
&& sudo gem install rake bundler pg | ||
|
||
# Build fluent-plugin-pgjson from scratch | ||
# Original fluent-plugin-pgjson is from https://github.com/fluent-plugins-nursery/fluent-plugin-pgjson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment why we need build our own
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -143,4 +144,27 @@ data: | |||
overflow_action block | |||
</buffer> | |||
</store> | |||
{% endif %} | |||
{% if (cluster_cfg['internal-storage']['enable']) and (cluster_cfg['postgresql']['enable']) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems you can use if else...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use something like:
job-attempt-storage-engine: "elasticsearch" # set it to "db" to use database backend
In reply to: 391421409 [](ancestors = 391421409)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use cluster_cfg['cluster']['common']['job-attempt-storage-engine'] instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approve with minor comment
#2850
How to use
The following service config should be set to enable internal storage, postgresql, and set rest-server to read job history from database.
What will happen if the database crashes
In such case, the health check of job attempt api will not pass. User won't be able to click it.
In backend side,
fluentd
will try to send chunk to postgresql forever. Once the postgresql db is restarted, the job attempt history will be recovered.Test
sleep 60s; echo failed at $(date); exit 233
, and set a retry numbers for it../paictl.py service stop -m postgresql
./paictl.py service start -m postgresql