Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: Parametrize the log dir #939

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

aleksei-burlakov
Copy link
Contributor

By default all logs are stored in /var/lib/heartbeat/trace_ra
This patch adds a new resource attribute trace_dir to the cib.file
The trace_dir should come alongside the trace_ra,
whereas trace_ra signals that the resource is traced,
the trace_dir defines the path.

@jpbuecken
Copy link

jpbuecken commented Feb 14, 2022

Nice, as a user, this is what we needed (as you know, a cluster is used to mitigate downtimes, and if we need to enable tracing in production a full /var is not very good to avoid downtimes :-) ).

Question: Will trace_dir be available as cluster wide default option so we can add it to our default setup and only switch trace_ra per resource if needed?

e.g

rsc_defaults rsc-options: \
        resource-stickiness=100 \
        is-managed=true \
        trace_dir="/extra/trace/fs"

EDIT:
or as xml/cib

    <rsc_defaults>
      <meta_attributes id="rsc-options">
        <nvpair name="resource-stickiness" value="100" id="rsc-options-resource-stickiness"/>
        <nvpair name="is-managed" value="true" id="rsc-options-is-managed"/>
        <nvpair name="trace_dir" value="/extra/trace/fs" id="rsc-options-trace_dir"/>
      </meta_attributes>
    </rsc_defaults>

@aleksei-burlakov
Copy link
Contributor Author

Oops, I forgot to put the reference to the draft PR #935

@jpbuecken , exactly, the cib file will be changed like (assumung there is a Dummy resource dummy1)

     <resources>                                                                                                                                                                             
       <primitive id="dummy1" class="ocf" provider="pacemaker" type="Dummy">                                                                                                                 
         <operations>                                                                                                                                                                                                    
          <op name="monitor" interval="15" id="dummy1-monitor-15"/>
           <op name="start" interval="0" id="dummy1-start-0">
             <instance_attributes id="dummy1-start-0-instance_attributes">
                <nvpair name="trace_ra" value="1" id="dummy1-start-0-instance_attributes-trace_ra"/>
+               <nvpair name="trace_dir" value="/foo/bar" id="dummy1-start-0-instance_attributes-trace_dir"/>
              </instance_attributes>                                                           
           </op>                                                                              
         </operations>                                                                        
       </primitive>                                                                           
     </resources>

@gao-yan
Copy link
Member

gao-yan commented Feb 14, 2022

Question: Will trace_dir be available as cluster wide default option so we can add it to our default setup and only switch trace_ra per resource if needed?

It's an op parameter, so it's likely to work with op_defaults like:

op_defaults trace_dir="/extra/trace/fs"

@aleksei-burlakov aleksei-burlakov force-pushed the feature/log-dir branch 2 times, most recently from b8ee982 to f0f7052 Compare March 16, 2022 12:00
@aleksei-burlakov
Copy link
Contributor Author

Hi @liangxin1300 , can you please approve my PR?

@liangxin1300
Copy link
Collaborator

Hi @liangxin1300 , can you please approve my PR?

Sorry for late, I will take a look today

Thanks!

@liangxin1300
Copy link
Collaborator

Other part of codes looks good to me.
Nice work! @aleksei-burlakov
After changing the doc part, I will merge and submit the code into 15SP4 in next week

By default all logs are stored in /var/lib/heartbeat/trace_ra
This patch adds a new resource attribute trace_dir to the cib.file
The trace_dir should come alongside the trace_ra,
whereas trace_ra signals that the resource is traced,
the trace_dir defines the path.
@aleksei-burlakov aleksei-burlakov force-pushed the feature/log-dir branch 2 times, most recently from 08de0fb to dadec52 Compare March 21, 2022 07:38
doc/website-v1/man-3.adoc Outdated Show resolved Hide resolved
doc/website-v1/man-3.adoc Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants