archiver_sample.ini 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. [DEFAULT]
  2. # The following parameter enable or disable an archiver
  3. # Default is to enable all archivers
  4. # can be override per archiver section
  5. # boolean options: yes/no 0/1 true/false
  6. enable=false
  7. # LIMIT applied to delete request
  8. # can be overrided in src section
  9. delete_limit=500
  10. # How many seconds to wait between 2 delete loop
  11. # can be overrided in src section
  12. delete_loop_delay=2
  13. # The LIMIT applied to a select
  14. # can be overrided in src section
  15. select_limit=1000
  16. # Number of statement to stack before commiting
  17. # will take the minimum between select_limit and bulk_insert
  18. bulk_insert=500
  19. # To skip archiving (and only delete because what else) set
  20. # archive_data to false
  21. # can be overrided in src section
  22. archive_data=true
  23. # Set delete_data to true if you want to delete data
  24. # from source backend
  25. # can be overrided in src section
  26. delete_data=false
  27. # The default column name that hold the date of
  28. # soft deleted data
  29. # can be overrided in src section
  30. deleted_column=deleted_at
  31. # The WHERE statement used to select rows to archive/delete
  32. # can be override in src section
  33. # {now}: python interpolation that will set the utcnow sql format date
  34. # ${deleted_column}, ${retention}: options of the config file
  35. where=${deleted_column} <= SUBDATE('{now}', INTERVAL ${retention})
  36. # Set foreign_key_check to false to disable foreign key check
  37. # can be overrided in src section
  38. foreign_key_check=true
  39. # Data lifetime
  40. retention=1 MONTH
  41. # Coma, cariage return or semicolon separated regexp which define databases to
  42. # exclude, the defautl are 'mysql', 'performance_schema', 'information_schema'
  43. excluded_databases=
  44. # Coma, cariage return or semicolon separated regexp which define tables to
  45. # exclude
  46. excluded_tables=shadow_.*
  47. # default file archive format
  48. archive_format=bztar
  49. # Declare an archiver called 'nova'
  50. # Read data from src named 'nova'
  51. # And write data in dst named db_archiver and file_archiver
  52. [archiver:nova]
  53. src=nova
  54. dst=db_archiver, file_archiver
  55. enable=true
  56. # Declare an archiver called 'glance'
  57. # Read data from src named 'nova'
  58. # And write data in dst named db_archiver and file_archiver
  59. # Disable it
  60. [archiver:glance]
  61. src=glance
  62. dst=db_archiver, file_archiver
  63. enable=false
  64. # Here we define the src 'nova'
  65. # Which is a db backend
  66. # We want to archive all the tables of database nova except those defined
  67. # by the regex excluded_tables, data are archived then deleted
  68. [src:nova]
  69. backend=db
  70. host=localhost
  71. port=3307
  72. user=root
  73. password=***********
  74. retention=12 MONTH
  75. databases=nova
  76. tables=*
  77. archive_data=true
  78. delete_data=true
  79. [src:glance]
  80. backend=db
  81. host=localhost
  82. port=3307
  83. user=root
  84. password=***********
  85. retention=12 MONTH
  86. databases=glance
  87. tables=*
  88. excluded_tables=images
  89. archive_data=true
  90. delete_data=true
  91. # db_archiver destination configuration
  92. # backend is a db
  93. # db is suffixed with '_archived'
  94. [dst:db_archiver]
  95. backend=db
  96. host=localhost
  97. port=3307
  98. user=root
  99. password=*********
  100. db_suffix=_archived
  101. # file_archiver destination configuation
  102. # backend is a file
  103. # with 2 formats: csv and sql
  104. [dst:file_archiver]
  105. backend=file
  106. directory=/tmp/archive_{date}
  107. formats=csv,sql
  108. remote_store=swift
  109. [remote_store:swift]
  110. backend=swift
  111. container=osarchiver
  112. # Remote filename is by default of this format:
  113. # 2022-01-12_11:08:19/cinder.volumes.sql.tar.bz2
  114. # With file_name_prefix it will become:
  115. # <file_name_prefix>/2022-01-12_11:08:19/cinder.volumes.sql.tar.bz2
  116. file_name_prefix=<Ex. region_name>
  117. # All the opt_* key will be available in store_options attribute
  118. # of the remote_store instance, usefull to pass specific options
  119. # to the underlying library which is used to send the data
  120. opt_auth_version=3
  121. opt_os_project_name=project_name
  122. opt_os_username=username
  123. opt_os_password=password
  124. opt_os_auth_url=https://auth.cloud.domain.net/v3
  125. opt_os_region_name=<swift_region_name>
  126. opt_os_project_domain_name=project_domain_name
  127. opt_os_user_domain_name=user_domain_name
  128. # opt_<option_name>=value
  129. # https://docs.openstack.org/python-swiftclient/latest/service-api.html
  130. # opt_retries = 5