Configure Persistent Volumes for Logging
Add persistent volumes to retain transaction and debug logs when containers are restarted.
About this task
Note: Configuration details for persistent volumes depend on site infrastructure details and can vary in specific
deployments.
Procedure
-
Update
kubernetes/example-engine-config-sideloader/config/resource_create_config.info
to add the following questions and answers.
Note: Because all
mtx-engine
pods share the same template, it is important to specify the log directory name withlocal_%e_%c_%b
.Do you want to use the default transaction log directory (y/n)?n What directory do you want to use for the transaction log files?/myssd/local_%e_%c_%b Do you want to use the default log directory (y/n)?n What directory do you want to use for the log files?/myssd/local_%e_%c_%b
-
Update
kubernetes/example/engine/my_obj_templates/engine_sts.yaml
to specify a
hostPath
volume. The configuration in the template must be different if you use another type of volume.Note: AThe commentshostPath
volume uses a file or directory on the node to emulate network-attached storage. Use an NFS share or similar in a production environment.# BEGIN_NEW_BLOCK
and# END_NEW_BLOCK
are added to clearly mark the boundary of new lines to be added. You do not have to add them in your file.apiVersion: apps/v1 kind: StatefulSet metadata: name: {name} spec: ... template: ... spec: volumes: # BEGIN_NEW_BLOCK - name: ssd-logs hostPath: path: /mylogs type: DirectoryOrCreate # END_NEW_BLOCK ... containers: ... volumeMounts: # BEGIN_NEW_BLOCK - mountPath: /myssd name: ssd-logs # END_NEW_BLOCK ...