Skip to content

节点配置 ​

节点配置对于每个节点都是独立的,不会在集群范围中共享。

在 Ignite 3 中,配置文件支持 HOCON 或 JSON 格式。配置文件有一个名为ignite的根节点,所有配置项都是该节点的子节点、孙节点等。

1.检查节点配置 ​

使用命令行工具可以获取节点配置信息:

  • 启动命令行工具并接入节点;
  • 运行node config show命令。

命令行工具会输出完整节点配置,如果只想要部分配置,可以将所需的属性作为命令行参数就可以缩小搜索范围,例如:

shell
node config show ignite.clientConnector

2.调整节点配置 ​

可以使用命令行工具调整节点的配置,做法如下:

  • 启动命令行工具并接入某个节点,该节点会成为后续操作的默认节点;
  • 要更新该节点的配置,运行node config updatenode config update命令并提供新的参数作为命令参数,例如:
    shell
    node config update ignite.clientConnector.connectTimeoutMillis=10000
  • 要更新其他节点的配置,需要先明确指定目标节点。例如,对于名为node1的节点:
    shell
    node config update -n node1 ignite.nodeAttributes.nodeAttributes.clientConnector="10900"
  • 重启该节点以使配置生效。

3.导出节点配置 ​

使用以下命令可以将节点配置导出为 HOCON 格式的文件:

shell
bin/ignite3 node config show > node-config.conf

4.配置参数 ​

4.1.客户端连接器配置 ​

客户端连接器的参数配置,请参见客户端连接器相关章节的内容。

4.2.计算配置 ​

json
{
  "ignite" : {
    "compute" : {
      "queueMaxSize" : 2147483647,
      "statesLifetimeMillis" : 60000,
      "threadPoolSize" : 10
    }
  }
}
属性默认值描述可修改需要重启可选值
queueMaxSize2147483647队列中的最大计算任务数是是1 - Integer.MAX_VALUE
statesLifetimeMillis60000作业完成后作业状态的生命周期(毫秒)是是0 - inf
threadPoolSize10可用于计算作业的线程数是是1 - Integer.MAX_VALUE

4.3.代码部署配置 ​

json
{
  "ignite" : {
    "deployment" : {
      "deploymentLocation" : "deployment"
    }
  }
}
属性默认值描述可修改需要重启可选值
deploymentLocationdeployment相对于工作目录的目录名,所有的部署单元都要保存在该位置是否有效的路径

4.4.故障处理器配置 ​

json
{
  "ignite" : {
    "failureHandler" : {
      "dumpThreadsOnFailure" : true,
      "dumpThreadsThrottlingTimeoutMillis" : 10000,
      "handler" : {
        "ignoredFailureTypes" : [
          "systemWorkerBlocked", "systemCriticalOperationTimeout"
        ],
        "type" : "noop"
      },
      "oomBufferSizeBytes" : 16384
    }
  }
}
属性默认值描述可修改需要重启可选值
dumpThreadsOnFailuretrue是否在故障发生时将线程转储到日志中是否true,false
dumpThreadsThrottlingTimeoutMillis10000故障处理期间生成线程转储的节流超时(毫秒)是否1 - inf
handler.ignoredFailureTypes[systemWorkerBlocked, systemCriticalOperationTimeout]会被忽略的故障类型列表。是否
handler.typenoop故障处理器类型是否noop、stop、stopOrHalt
oomBufferSizeBytes16384节点开始时堆中保留的内存量(字节)。是否1 - inf

4.5.网络配置 ​

Ignite 3 中支持2种节点发现类型,对于STATIC类型,需要手工指定节点的地址,对于MULTICAST类型,会自动发现网内的节点,可以简化配置。

  • STATIC节点探测器配置示例:
    json
    {
      "ignite" : {
        "network" : {
          "fileTransfer" : {
            "chunkSizeBytes" : 1048576,
            "maxConcurrentRequests" : 4,
            "responseTimeoutMillis" : 10000,
            "threadPoolSize" : 8
          },
          "inbound" : {
            "soBacklog" : 128,
            "soKeepAlive" : true,
            "soLinger" : 0,
            "soReuseAddr" : true,
            "tcpNoDelay" : true
          },
          "listenAddresses" : [],
          "membership" : {
            "failurePingIntervalMillis" : 1000,
            "membershipSyncIntervalMillis" : 30000,
            "scaleCube" : {
              "failurePingRequestMembers" : 3,
              "gossipIntervalMillis" : 200,
              "gossipRepeatMult" : 3,
              "membershipSuspicionMultiplier" : 5,
              "metadataTimeoutMillis" : 3000
            }
          },
          "nodeFinder" : {
            "netClusterNodes" : [ "localhost:3344" ],
            "type" : "STATIC"
          },
          "outbound" : {
            "soKeepAlive" : true,
            "soLinger" : 0,
            "tcpNoDelay" : true
          },
          "port" : 3344,
          "shutdownQuietPeriodMillis" : 0,
          "shutdownTimeoutMillis" : 15000,
          "ssl" : {
            "ciphers" : "",
            "clientAuth" : "none",
            "enabled" : false,
            "keyStore" : {
              "password" : "********",
              "path" : "",
              "type" : "PKCS12"
            },
            "trustStore" : {
              "password" : "********",
              "path" : "",
              "type" : "PKCS12"
            }
          }
        }
      }
    }
  • 对于MULTICAST节点探测器,需要更新配置文件的nodeFinder段,如下所示:
    json
    {
      "ignite" : {
        "nodeFinder": {
          "type": "MULTICAST",
          "multicast" : {
            "group": "239.192.0.0",
            "port": 47401,
            "resultWaitTime": 500,
            "ttl": -1
          }
        }
      }
    }
属性默认值描述可修改需要重启可选值
fileTransfer文件传输配置
fileTransfer.chunkSizeBytes1048576区块大小(字节)是是1 - Integer.MAX_VALUE
fileTransfer.maxConcurrentRequests4最大并发请求数是是1 - Integer.MAX_VALUE
fileTransfer.responseTimeoutMillis10000文件传输期间的节点响应超时是是0 - inf
fileTransfer.threadPoolSize8文件发送方线程池大小是是1 - Integer.MAX_VALUE
inbound服务器套接字配置,具体请参加 TCP 和 套接字的文档
inbound.soBacklog128积压量的大小是是0 - Integer.MAX_VALUE
inbound.soKeepAlivetrue是否允许保活状态的数据包是是true,false
inbound.soLinger0关闭的套接字应延迟多长时间是是0 - 65535
inbound.soReuseAddrtrue是否允许地址复用是是true,false
inbound.tcpNoDelaytrue是否使用 TCP_NODELAY 选项是是true,false
listenAddresses要监听的地址列表(IP或主机名),如果为空则监听所有的地址。目前只支持一个地址,该限制将在未来的更新中取消。是是用逗号分隔的有效地址列表
membership节点成员资格配置
membership.failurePingIntervalMillis1000故障检测 ping 间隔是是0 - inf
membership.membershipSyncIntervalMillis30000定期成员数据同步间隔是是0 - inf
membership.scaleCubeScaleCube 配置
scaleCube.failurePingRequestMembers3为间接 ping 请求随机选择的成员数是是1 - inf
scaleCube.gossipIntervalMillis200Gossip传播间隔是是1 - inf
scaleCube.gossipRepeatMult3Gossip 重复乘数是是1 - inf
scaleCube.membershipSuspicionMultiplier5用于计算超时的乘数,超过该值后节点将被视为无效是是1 - inf
scaleCube.metadataTimeoutMillis3000元数据更新操作的超时时间(毫秒)是是1 - inf
nodeFinder节点在集群中探测其他节点的配置
nodeFinder.netClusterNodes集群中所有节点的地址,采用 host:port 格式,适用于STATIC节点探测器。是是有效的地址
nodeFinder.typeSTATIC节点探测器类型,使用STATIC需手工配置节点地址。是是STATIC
nodeFinder.typeMULTICAST节点探测器类型,使用MULTICAST可以自动探测网内的节点,使用该类型时,需指定一个组播组地址。是是MULTICAST
nodeFinder.multicast.group239.192.0.0用于发现的组播组地址是是有效的组播组地址
nodeFinder.multicast.port47401用于发现的组播组端口是是0 - 65535
nodeFinder.multicast.resultWaitTime500等待发现结果的超时时间(毫秒)是是1 - inf
nodeFinder.multicast.ttl-1设置组播数据包的最大网络跃点数,默认值为-1,并使用默认的系统TTL。是是-1 - 255
outbound输出请求的配置
outbound.soKeepAlivetrue是否允许保活状态的数据包是是true,false
outbound.soLinger0关闭的套接字应延迟多长时间是是0 - 65535
outbound.tcpNoDelaytrue是否使用 TCP_NODELAY 选项是是true,false
port3344节点端口是是有效的端口号
shutdownQuietPeriodMillis0节点关闭期间 Ignite 确保在节点自行关闭之前不提交任何任务的时间段,如果在此期间提交了任务还可以被接受是否0 - inf
shutdownTimeoutMillis15000节点关闭前的最长时间,无论在shutdownQuietPeriodMillis期间是否提交了新的网络消息。是否0 - inf
ssl.ciphers要启用的密码列表,以逗号分隔。为空表示自动选择密码是是TLS_AES_256_GCM_SHA384 等(标准密码 ID)
ssl.clientAuthnone是否启用 SSL 客户端身份验证以及是否为强制性身份验证是是none,optional,require
ssl.enabledfalse是否为节点启用 SSL是是true,false
ssl.keyStoreSSL 密钥库配置
keyStore.password密钥库密码是是有效的密码
keyStore.path密钥库路径是是有效的路径
keyStore.typePKCS12密钥库类型是是PKCS12,JKS
ssl.trustStoreSSL 信任库配置
trustStore.password信任库密码是是有效的密码
trustStore.path信任库路径是是有效的路径
trustStore.typePKCS12信任库类型是是PKCS12,JKS

4.6.节点属性 ​

json
{
  "ignite" : {
    "nodeAttributes" : {
      "nodeAttributes" : { }
    }
  }
}
属性默认值描述可修改需要重启可选值
nodeAttributes用于将数据动态分发到具有指定属性值的节点的节点属性集合。是是JSON 格式的对象

4.7.Raft配置 ​

json
{
  "ignite" : {
    "raft" : {
      "fsync" : false,
      "installSnapshotTimeoutMillis" : 300000,
      "logStripesCount" : 4,
      "logYieldStrategy" : false,
      "responseTimeoutMillis" : 3000,
      "retryDelayMillis" : 200,
      "retryTimeoutMillis" : 10000,
      "stripes" : 10,
      "volatileRaft" : {
        "logStorageBudget" : {
          "name" : "unlimited"
        }
      }
    }
  }
}
属性默认值描述可修改需要重启可选值
fsyncfalse指定在确认复制之前,是否使用fsync将 Raft 日志安全地写入表分区组上的磁盘。如果设置为false,则在操作系统故障时用户数据可能会丢失,但Ignite故障不会导致数据丢失。是是true、false
installSnapshotTimeoutMillis300000允许将 Raft 快照传输给接收方并安装的最长允许时间。是否1 - inf
logStripesCount4日志管理器的 Disruptor 中的并行度是是1 - inf
logYieldStrategyfalse如果为 true,则在日志管理器的 Disruptor 中使用非阻塞策略。是是true,false
responseTimeoutMillis3000Raft 客户端将尝试从远程对等体接收响应的时间段是否0 - inf
retryDelayMillis200Raft 客户端重新发送失败请求的延迟是否0 - inf
retryTimeoutMillis10000Raft 客户端尝试从远程对等体接收成功响应的时间段是否0 - inf
volatileRaft.logStorageBudget.nameunlimited节点使用的日志存储名。是否,但是新的值仅适用于新的分区unlimited、entry-count

4.8.REST配置 ​

json
{
  "ignite" : {
    "rest" : {
      "dualProtocol" : false,
      "httpToHttpsRedirection" : false,
      "port" : 10300,
      "ssl" : {
        "ciphers" : "",
        "clientAuth" : "none",
        "enabled" : false,
        "keyStore" : {
          "password" : "********",
          "path" : "",
          "type" : "PKCS12"
        },
        "port" : 10400,
        "trustStore" : {
          "password" : "********",
          "path" : "",
          "type" : "PKCS12"
        }
      }
    }
  }
}
属性默认值描述可修改需要重启可选值
dualProtocolfalse端点是否同时使用 HTTP 和 HTTPS 协议。是是true,false
httpToHttpsRedirectionfalse是否将 HTTP 端点重定向到 HTTPS 端点。是是true,false
port10300节点的 REST 端点的端口。是是有效的端口
ssl.ciphers显式设置节点 SSL 密码。是是查看可选值
ssl.clientAuth是否启用 SSL 客户端身份验证以及是否为强制性身份验证。是是none、optional、require
ssl.enabledfalse是否为节点启用 SSL。是是true,false
ssl.keyStoreSSL 密钥库配置
keyStore.password密钥库密码是是有效的密码
keyStore.path密钥库路径是是有效的路径
keyStore.typePKCS12密钥库类型是是PKCS12、JKS
ssl.port10400用于 SSL 连接的端口。是是有效的端口
ssl.trustStoreSSL 信任库配置
trustStore.password信任库密码是是有效的密码
trustStore.path信任库路径是是有效的路径
trustStore.typePKCS12信任库类型是是PKCS12、JKS

4.9.SQL配置 ​

json
{
  "ignite" : {
    "sql" : {
      "execution" : {
        "threadCount" : 4
      },
      "planner" : {
        "threadCount" : 4
      }
    }
  }
}
属性默认值描述可修改需要重启可选值
execution.threadCount4用于查询执行的线程数。是是1 - Integer.MAX_VALUE
planner.threadCount4用于查询计划的线程数。是是1 - Integer.MAX_VALUE

4.10.存储配置 ​

Ignite 的持久化追求读写的高性能。使用持久化时,Ignite 将所有数据存储在磁盘上,并将尽可能多的数据加载到内存中进行处理。Ignite 会将每个分区存储在磁盘上的单独文件中,除了数据分区之外,Ignite 还存储索引和元数据。

每个 Ignite 存储引擎可以有多个存储方案。

检查点是将脏页从内存复制到磁盘上分区文件的过程。脏页是在内存中更新但未写入相应分区文件的页。检查点完成后,所有更改都将保存到磁盘上,并在节点故障并重启时仍然可用。检查点旨在确保数据的持久性并在节点发生故障时进行恢复。此过程通过使磁盘上的页面保持最新状态,能更高效地利用磁盘空间。

json
{
 "ignite" : {
    "storage" : {
      "engines" : {
        "aimem" : {
          "pageSizeBytes" : 16384
        },
        "aipersist" : {
          "checkpoint" : {
            "checkpointDelayMillis" : 200,
            "checkpointThreads" : 4,
            "compactionThreads" : 4,
            "intervalMillis" : 180000,
            "intervalDeviationPercent" : 40,
            "logReadLockThresholdTimeout" : 0,
            "readLockTimeoutMillis" : 10000,
            "useAsyncFileIoFactory" : true
          },
          "pageSizeBytes" : 16384
        },
        "rocksdb" : {
          "flushDelayMillis" : 100
        },
      "profiles" : [ {
        "engine" : "aipersist",
        "name" : "default",
        "replacementMode" : "CLOCK",
        "sizeBytes" : 268435456
      },
      {
        "engine" : "aimem",
        "name" : "default_aimem",
        "emptyPagesPoolSize" : 100,
        "initSizeBytes" : 268435456,
        "maxSizeBytes" : 268435456
      },
      {
        "engine" : "rocksdb",
        "name" : "default_rocksdb",
        "sizeBytes" : 268435456,
        "writeBufferSizeBytes" : 67108864
      } ]
   }
  }
 }
}
属性默认值描述可修改需要重启可选值
engines.aimem内存存储方案
aimem.pageSizeBytes16384内存存储的页面大小(字节)。是是1024-16384
engines.aipersist原生存储方案
aipersist.checkpoint.checkpointDelayMillis200在收到命令后启动检查点之前的延迟。是否0 - inf
aipersist.checkpoint.checkpointThreads4用于检查点的线程数。是是1 - inf
aipersist.checkpoint.compactionThreads4用于数据压缩的线程数。是是1 - inf
aipersist.checkpoint.intervalMillis180000检查点之间的间隔(毫秒)。是否0 - inf
aipersist.checkpoint.intervalDeviationPercent40从下一个计划检查点之前的时间段中添加或减去的抖动(百分比)。是否0 - 100
aipersist.checkpoint.logReadLockThresholdTimeoutMillis0记录长读锁定的阈值(毫秒)。是是0 - inf
aipersist.checkpoint.readLockTimeoutMillis10000检查点读取锁获取的超时时间(毫秒)。是是0 - inf
aipersist.checkpoint.useAsyncFileIoFactorytrueIgnite 是否使用异步文件 I/O 操作程序。是是true、false
aipersist.pageSizeBytes16384原生存储的页面的大小(字节)。否不适用1024-16384
engines.rocksdbRocksDB 存储方案
rocksdb.flushDelayMillis100执行 Raft 触发的刷新之前的延迟。是引擎注册时刷新0 - inf
profiles可用存储方案的列表。
engine存储引擎。否不适用aimem、aipersist、rocksdb
name用户定义的配置名。否不适用有效的名字
replacementModeCLOCK页面替换算法。是是CLOCK、RANDOM_LRU、SEGMENTED_LRU
size268435456内存区的大小(字节)。是是最小268435456,最大由操作系统的可寻址内存限制定义
aipersist.sizeBytes268435456堆外内存区的大小(字节)。是是最小268435456,最大由操作系统的可寻址内存限制定义
aipersist.replacementModeCLOCK页面替换算法。是是CLOCK、RANDOM_LRU、SEGMENTED_LRU
aimem.initSizeBytes268435456初始内存区大小(字节),超过该值后,会申请新的内存块。是是最小256MB,最大由操作系统的可寻址内存限制定义
aimem.maxSizeBytes268435456最大内存区大小(字节)。是是最小256MB,最大由操作系统的可寻址内存限制定义
rocksdb.sizeBytes268435456RocksDB 的堆外缓冲区大小(字节)。是是最小值为0,最大由操作系统的可寻址内存限制定义
rocksdb.writeBufferSizeBytes67108864RocksDB 的写缓冲区大小(字节)。是是最小值为1,最大由操作系统的可寻址内存限制定义

4.11.系统配置 ​

本章节介绍 Ignite 的内部属性。虽然也可以像编辑所有其他属性一样编辑这些属性,即使用命令行工具的node config update命令,但建议开发者慎重修改。这些属性可以适用某个节点(见下文),也可以适用整个集群。

提示

注意,属性名为驼峰式。

json
{
  "ignite" : {
    "system" : {
      "cmgPath" : "",
      "metastoragePath" : "",
      "partitionsBasePath" : "",
      "partitionsLogPath" : "",
      "properties":[],
      "criticalWorkers" : {
        "livenessCheckIntervalMillis" : 2000,
        "maxAllowedLagMillis" : 5000,
        "nettyThreadsHeartbeatIntervalMillis" : 1000
      }
    }
  }
}
属性默认值描述可修改需要重启可选值
system.cmgPath集群管理组信息的存储路径。仅当节点是 CMG 的一部分时适用。数据默认存储在{IGNITE_HOME}/work/cmg,建议仅在空节点上更改此路径。是是有效的绝对路径。
system.metastoragePath集群元信息的存储路径。仅当节点是元存储组的一部分时适用。数据默认存储在{IGNITE_HOME}/work/metastorage,建议仅在空节点上更改此路径。是是有效的绝对路径。
system.partitionsBasePath数据分区的存储路径。分区默认存储在{IGNITE_HOME}/work/partitions。建议仅在空节点上更改此路径。是是有效的绝对路径。
system.partitionsLogPath数据分区的 Raft 日志存储路径。分区默认存储在{system.partitionsBasePath}/log,建议仅在空节点上更改此路径。是是有效的绝对路径。
system.propertiesIgnite 组件使用的系统属性。是是属性映射。
system.criticalWorkers.livenessCheckIntervalMillis2000用于检查关键工作线程是否存活的间隔(毫秒)。是是1 - inf(不能大于maxAllowedLagMillis的一半)
system.criticalWorkers.maxAllowedLagMillis5000从上次心跳到当前时间的最大允许延迟(毫秒),超过则认为关键工作线程被阻塞。是是1 - inf(至少是livenessCheckInterval的两倍)
system.criticalWorkers.nettyThreadsHeartbeatIntervalMillis1000用于更新Netty线程心跳时间戳的间隔(毫秒)。是是1 - inf

18624049226