leveldb 数据库的 Tron 全节点磁盘空间限制

问题描述 投票:0回答:1

美好的一天。我有 config.conf 文件作为 TRON Fullnode.jar 版本 GreatVoyage-v4.7.1.1(Pittacus) 的配置。我在fullnode中使用lite模式。我有两个问题:

  1. 如何将 tron fullnode 数据库(leveldb 格式)的磁盘空间限制为最大 50GB?
  2. 今天我有94GB的数据库,我怎样才能将其清除到50GB?举个例子,我可以清除所有行并仅保存最近 20 天内创建的所有行。我怎样才能做到这一点? 我没有在原始文档中对解决方案进行罚款,机器人我知道解决方案的变体必须始终是。

我在 config.conf 文件中为我的数据库使用此配置:

storage {
  db.version = 2,
  db.engine = "LEVELDB",
  db.sync = false,
  db.directory = "/tron-database",
  index.directory = "/tron-index",
  transHistory.switch = "off",

  #default = {
  #  maxOpenFiles = 100
  #}
  #defaultM = {
  #  maxOpenFiles = 500
  #}
  #defaultL = {
  #  maxOpenFiles = 1000
  #}

  properties = [
    # {
    #   name = "account",
    #   path = "storage_directory_test",
    #   createIfMissing = true,
    #   paranoidChecks = true,
    #   verifyChecksums = true,
    #   compressionType = 1,        # compressed with snappy
    #   blockSize = 4096,           # 4  KB =         4 * 1024 B
    #   writeBufferSize = 10485760, # 10 MB = 10 * 1024 * 1024 B
    #   cacheSize = 10485760,       # 10 MB = 10 * 1024 * 1024 B
    #   maxOpenFiles = 100
    # },
    # {
    #   name = "account-index",
    #   path = "storage_directory_test",
    #   createIfMissing = true,
    #   paranoidChecks = true,
    #   verifyChecksums = true,
    #   compressionType = 1,        # compressed with snappy
    #   blockSize = 4096,           # 4  KB =         4 * 1024 B
    #   writeBufferSize = 10485760, # 10 MB = 10 * 1024 * 1024 B
    #   cacheSize = 10485760,       # 10 MB = 10 * 1024 * 1024 B
    #   maxOpenFiles = 100
    # },
  ]

  needToUpdateAsset = true

  # dbsettings is needed when using rocksdb as the storage implement (db.version=2 and db.engine="ROCKSDB").
  # we'd strongly recommend that do not modify it unless you know every item's meaning clearly.
  dbSettings = {
    levelNumber = 7
    # compactThreads = 32
    blocksize = 64  # n * KB
    maxBytesForLevelBase = 256  # n * MB
    maxBytesForLevelMultiplier = 10
    level0FileNumCompactionTrigger = 4
    targetFileSizeBase = 256  # n * MB
    targetFileSizeMultiplier = 1
  }

  # backup settings when using rocks db as the storage implement (db.version=2 and db.engine="ROCKSDB").
  # if you want to use the backup plugin, please confirm set the db.version=2 and db.engine="ROCKSDB" above.
  backup = {
    enable = true  # indicate whether enable the backup plugin
    propPath = "prop.properties" # record which bak directory is valid
    bak1path = "/tron-backup/database" # you must set two backup directories to prevent application halt unexpected(e.g. kill -9).
    bak2path = "/tron-backup2/database"
    frequency = 1000   # indicate backup db once every 10000 blocks processed.
  }
}
configuration blockchain tron
1个回答
0
投票

可能有些误解,2023 年 5 月的完整账本的大小为 1.5T。目前比较多这个。想要将大小限制为 50G 是什么意思?

© www.soinside.com 2019 - 2024. All rights reserved.