github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/pulsar/config/bookies-config.tpl (about)

     1  {{- $phy_memory := getContainerMemory ( index $.podSpec.containers 0 ) }}
     2  
     3  journalDirectories=/pulsar/data/bookkeeper/journal
     4  compactionRateByBytes=52428800
     5  useTransactionalCompaction=true
     6  
     7  ## for bookies storage configuration
     8  
     9  {{- if gt $phy_memory 0 }}
    10  {{- $phy_memory_mb := div $phy_memory ( mul 1024 1024 ) }}
    11  ## 25% of the available direct memory
    12  dbStorage_writeCacheMaxSizeMb={{ div $phy_memory_mb 4 }}
    13  dbStorage_readAheadCacheMaxSizeMb={{ div $phy_memory_mb 4 }}
    14  {{- end }}
    15  
    16  dbStorage_readAheadCacheBatchSize=100
    17  dbStorage_rocksDB_blockSize=268435456
    18  dbStorage_rocksDB_writeBufferSizeMB=64
    19  dbStorage_rocksDB_sstSizeInMB=64
    20  dbStorage_rocksDB_blockSize=65536
    21  dbStorage_rocksDB_bloomFilterBitsPerKey=10
    22  dbStorage_rocksDB_numLevels=-1
    23  dbStorage_rocksDB_numFilesInLevel0=10
    24  dbStorage_rocksDB_maxSizeInLevel1MB=256
    25  
    26  ## for disk utilization
    27  # For each ledger dir, maximum disk space which can be used. Default is 0.95f. i.e. 95% of disk can be used at most after which nothing will be written to that partition. If all ledger dir partions are full, then bookie will turn to readonly mode if 'readOnlyModeEnabled=true' is set, else it will shutdown. Valid values should be in between 0 and 1 (exclusive).
    28  diskUsageThreshold=0.95
    29  # The disk free space low water mark threshold. Disk is considered full when usage threshold is exceeded. Disk returns back to non-full state when usage is below low water mark threshold. This prevents it from going back and forth between these states frequently when concurrent writes and compaction are happening. This also prevent bookie from switching frequently between read-only and read-writes states in the same cases.
    30  diskUsageWarnThreshold=0.95
    31  # Set the disk free space low water mark threshold. Disk is considered full when usage threshold is exceeded. Disk returns back to non-full state when usage is below low water mark threshold. This prevents it from going back and forth between these states frequently when concurrent writes and compaction are happening. This also prevent bookie from switching frequently between read-only and read-writes states in the same cases.
    32  diskUsageLwmThreshold=0.9
    33  # Disk check interval in milliseconds. Interval to check the ledger dirs usage.
    34  diskCheckInterval=10000
    35  
    36  ## for Journal settings
    37  journalDirectories=/pulsar/data/bookkeeper/journal
    38  #journalDirectory=/pulsar/data/bookkeeper/txn
    39  journalFormatVersionToWrite=5
    40  journalMaxSizeMB=2048
    41  journalMaxBackups=5
    42  journalPreAllocSizeMB=16
    43  journalWriteBufferSizeKB=64
    44  journalRemoveFromPageCache=true
    45  journalSyncData=true
    46  journalAdaptiveGroupWrites=true
    47  journalMaxGroupWaitMSec=2
    48  journalBufferedWritesThreshold=524288
    49  journalFlushWhenQueueEmpty=false
    50  journalAlignmentSize=512
    51  # Maximum entries to buffer to impose on a journal write to achieve grouping.
    52  journalBufferedEntriesThreshold=0
    53  journalFlushWhenQueueEmpty=false
    54  journalQueueSize=10000
    55  
    56  # TODO fix: For persisiting explicitLac, journalFormatVersionToWrite should be >= 6and FileInfoFormatVersionToWrite should be >= 1
    57  # fileInfoFormatVersionToWrite=1
    58  
    59  # how long to wait, in seconds, before starting autorecovery of a lost bookie.
    60  # TODO: set to 0 after opsRequest for rollingUpdate supports hooks
    61  lostBookieRecoveryDelay=300
    62  httpServerEnabled=true
    63  httpServerPort=8000
    64  ledgerDirectories=/pulsar/data/bookkeeper/ledgers
    65  # statsProviderClass ref: https://bookkeeper.apache.org/docs/admin/metrics#stats-providers
    66  statsProviderClass=org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
    67  enableStatistics=true
    68  useHostNameAsBookieID=true
    69  
    70  zkLedgersRootPath=/ledgers
    71  
    72  {{- $autoRecoveryDaemonEnabled := "true" }}
    73  {{- range $i, $e := $.cluster.spec.componentSpecs }}
    74    {{- if eq $e.componentDefRef "bookies-recovery" }}
    75      {{- $autoRecoveryDaemonEnabled = "false" }}
    76    {{- end }}
    77  {{- end }}
    78  autoRecoveryDaemonEnabled={{ $autoRecoveryDaemonEnabled }}