PageSourceSearch

https://montplex.com/static/js/async/4481.53042bda.js

js montplex.com collected 2026-10-03 21:16:56 UTC 17,155 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkengula_website=self.webpackChunkengula_website||[]).push([["4481"],{3392:function(e,n,l){l.r(n),l.d(n,{default:()=>i});var d=l(2676),a=l(453),r=l(604);function s(e){let n=Object.assign({h1:"h1",a:"a",p:"p",code:"code",h2:"h2",pre:"pre",table:"table",thead:"thead",tr:"tr",th:"th",tbody:"tbody",td:"td",h3:"h3",ul:"ul",li:"li"},(0,a.ah)(),e.components);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(n.h1,{id:"engula-配置指南",children:["Engula 配置指南",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#engula-配置指南",children:"#"})]}),"\n",(0,d.jsxs)(n.p,{children:["Engula 的配置文件语法与 Valkey 7.2 保持兼容;从 Redis 7.2 迁移时,通用配置通常也可以按兼容语义理解。除本文列出的 ",(0,d.jsx)(n.code,{children:"engula-*"})," 专属配置外,端口、持久化、复制、内存淘汰、ACL、TLS、慢日志等通用配置以 Valkey 7.2 参数为主要参考。"]}),"\n",(0,d.jsxs)(n.p,{children:["这意味着迁移时通常不需要重写已有 ",(0,d.jsx)(n.code,{children:"redis.conf"}),"。更常见的做法是先复用原配置,再按评估目标补充 Engula 专属项,例如迁移完成后是否启用 Engula RDB、是否限制进入 earena 的对象大小、是否配置 license 文件。"]}),"\n",(0,d.jsxs)(n.h2,{id:"配置文件",children:["配置文件",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#配置文件",children:"#"})]}),"\n",(0,d.jsx)(n.p,{children:"Engula 可以在没有配置文件的情况下使用内置默认值启动。这种方式适合临时测试,不建议用于生产。生产环境应使用明确的配置文件,并把运行时变更同步回配置管理系统。"}),"\n",(0,d.jsx)(n.p,{children:"常见启动方式:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-bash",children:"engula-server /etc/engula/engula.conf\n"})}),"\n",(0,d.jsx)(n.p,{children:"如果已有 Redis / Valkey 配置,可以直接作为主配置文件使用,再在文件末尾加入 Engula 片段:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"include /etc/engula/engula-only.conf\n"})}),"\n",(0,d.jsxs)(n.p,{children:["把 ",(0,d.jsx)(n.code,{children:"include"})," 放在末尾更容易管理覆盖关系。通用 Redis / Valkey 配置保留在主文件里,Engula 专属配置集中放在片段文件里,便于升级和审计。"]}),"\n",(0,d.jsx)(n.p,{children:"多实例部署时,至少为每个实例隔离这些配置:"}),"\n",(0,d.jsxs)(n.table,{children:["\n",(0,d.jsxs)(n.thead,{children:["\n",(0,d.jsxs)(n.tr,{children:["\n",(0,d.jsx)(n.th,{children:"配置项"}),"\n",(0,d.jsx)(n.th,{children:"目的"}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.tbody,{children:["\n",(0,d.jsxs)(n.tr,{children:["\n",(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"port"})," / ",(0,d.jsx)(n.code,{children:"bind"})]}),"\n",(0,d.jsx)(n.td,{children:"避免监听端口或地址冲突"}),"\n"]}),"\n",(0,d.jsxs)(n.tr,{children:["\n",(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"dir"})}),"\n",(0,d.jsx)(n.td,{children:"隔离 RDB / AOF / 临时文件目录"}),"\n"]}),"\n",(0,d.jsxs)(n.tr,{children:["\n",(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"logfile"})}),"\n",(0,d.jsx)(n.td,{children:"隔离日志输出"}),"\n"]}),"\n",(0,d.jsxs)(n.tr,{children:["\n",(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"replicaof"})}),"\n",(0,d.jsx)(n.td,{children:"配置副本关系"}),"\n"]}),"\n",(0,d.jsxs)(n.tr,{children:["\n",(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"requirepass"})," / ",(0,d.jsx)(n.code,{children:"masterauth"})]}),"\n",(0,d.jsx)(n.td,{children:"对齐认证配置"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.h2,{id:"指令格式",children:["指令格式",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#指令格式",children:"#"})]}),"\n",(0,d.jsx)(n.p,{children:"配置指令采用空格分隔格式:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"keyword argument1 argument2 ... argumentN\n"})}),"\n",(0,d.jsx)(n.p,{children:"例如:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:'replicaof 127.0.0.1 6380\nrequirepass "hello world"\nengula-rdb 1\n'})}),"\n",(0,d.jsx)(n.p,{children:"参数中包含空格时使用单引号或双引号:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:'engula-license "/etc/engula/customer license.lic"\n'})}),"\n",(0,d.jsxs)(n.p,{children:["完整的通用配置项请参考 ",(0,d.jsx)(n.a,{href:"https://valkey.io/topics/valkey.conf/",target:"_blank",rel:"noopener noreferrer",children:"Valkey 7.2 配置文档"}),"。该链接用于通用语法与参数说明参考;具体可用项、默认值和 Engula 专属配置以本文链接的版本化配置文件为准。"]}
1),"\n",(0,d.jsxs)(n.h2,{id:"命令行覆盖",children:["命令行覆盖",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#命令行覆盖",children:"#"})]}),"\n",(0,d.jsxs)(n.p,{children:["所有配置指令也可以通过命令行传入。命令行形式和配置文件一致,只是配置名需要加 ",(0,d.jsx)(n.code,{children:"--"})," 前缀:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-bash",children:"engula-server --port 6380 --replicaof 127.0.0.1 6379 --engula-rdb 0\n"})}),"\n",(0,d.jsx)(n.p,{children:"命令行参数适合测试、容器启动参数或临时覆盖。生产环境仍建议把最终配置落回文件。"}),"\n",(0,d.jsxs)(n.h2,{id:"运行时配置",children:["运行时配置",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#运行时配置",children:"#"})]}),"\n",(0,d.jsx)(n.p,{children:"Engula 支持 Redis / Valkey 的运行时配置命令:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"CONFIG GET <pattern>\nCONFIG SET <parameter> <value>\nCONFIG REWRITE\n"})}),"\n",(0,d.jsx)(n.p,{children:"并非所有配置都能运行时修改。标记为启动时生效的配置必须写入配置文件并重启实例。"}),"\n",(0,d.jsxs)(n.p,{children:["Engula 专属项是 hidden config,不会出现在 ",(0,d.jsx)(n.code,{children:"CONFIG GET *"})," 的结果里。查询时请使用完整名称:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"CONFIG GET engula-rdb\nCONFIG GET engula-earena-max-value-size\n"})}),"\n",(0,d.jsx)(n.p,{children:"运行时修改示例:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"CONFIG SET engula-rdb 0\nCONFIG SET engula-earena-max-value-size 16777216\nCONFIG SET engula-disable-string yes\n"})}),"\n",(0,d.jsxs)(n.p,{children:["其中 ",(0,d.jsx)(n.code,{children:"engula-rdb"})," 与 ",(0,d.jsx)(n.code,{children:"engula-disable-*"})," 适用于 Engula 2.2 及以上版本;旧版本请以对应版本的配置文件为准。"]}),"\n",(0,d.jsxs)(n.p,{children:["运行时修改不会自动写回配置文件。需要持久化时,优先修改配置管理系统中的源配置文件;如果使用 ",(0,d.jsx)(n.code,{children:"include"})," 片段或自动化配置管理,请先确认 ",(0,d.jsx)(n.code,{children:"CONFIG REWRITE"})," 的写回位置和格式符合预期,再在生产环境使用。"]}),"\n",(0,d.jsxs)(n.h2,{id:"版本化配置文件",children:["版本化配置文件",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#版本化配置文件",children:"#"})]}),"\n",(0,d.jsxs)(n.p,{children:["具体配置项以配置文件文本为准。本文只说明如何选择和使用这些文件;后续配置项新增或变更时,优先更新对应版本的 ",(0,d.jsx)(n.code,{children:".conf"})," 文件。"]}),"\n",(0,d.jsxs)(n.p,{children:["Engula 2.2 配置文件: ",(0,d.jsx)(n.a,{href:"/config/engula/2.2/full",children:(0,d.jsx)(n.code,{children:"full.conf"})})," 和 ",(0,d.jsx)(n.a,{href:"/config/engula/2.2/engula-only",children:(0,d.jsx)(n.code,{children:"engula-only.conf"})}),"。"]}),"\n",(0,d.jsxs)(n.p,{children:["Engula 2.1 配置文件: ",(0,d.jsx)(n.a,{href:"/config/engula/2.1/full",children:(0,d.jsx)(n.code,{children:"full.conf"})})," 和 ",(0,d.jsx)(n.a,{href:"/config/engula/2.1/engula-only",children:(0,d.jsx)(n.code,{children:"engula-only.conf"})}),"。"]}),"\n",(0,d.jsxs)(n.p,{children:["Engula 2.0 配置文件: ",(0,d.jsx)(n.a,{href:"/config/engula/2.0/full",children:(0,d.jsx)(n.code,{children:"full.conf"})})," 和 ",(0,d.jsx)(n.a,{href:"/config/engula/2.0/engula-only",children:(0,d.jsx)(n.code,{children:"engula-only.conf"})}),"。"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"full.conf"})," 是对应版本的完整 Engula 配置文件,包含 Redis / Valkey 兼容配置和 Engula 专属配置。",(0,d.jsx)(n.code,{children:"engula-only.conf"})," 只包含 ",(0,d.jsx)(n.code,{children:"engula-*"})," 配置,适合通过 ",(0,d.jsx)(n.code,{children:"include"})," 追加到已有 Redis / Valkey 配置后面。"]}),"\n",(0,d.jsxs)(n.p,{children:["不同版本的 ",(0,d.jsx)(n.code,{children:"engula-*"})," 配置并不完全相同。升级时不要把旧版本的 Engula 配置片段直接复制到新版本,请以目标版本的 ",(0,d.jsx)(n.code,{children:"engula-only.conf"})," 为准。"]}
1),"\n",(0,d.jsxs)(n.h2,{id:"常见配置场景",children:["常见配置场景",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#常见配置场景",children:"#"})]}),"\n",(0,d.jsxs)(n.h3,{id:"最小单机实例",children:["最小单机实例",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#最小单机实例",children:"#"})]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:'port 6379\ndir /var/lib/engula\nlogfile "/var/log/engula/engula.log"\n'})}),"\n",(0,d.jsxs)(n.h3,{id:"使用-engula-rdb",children:["使用 Engula RDB",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#使用-engula-rdb",children:"#"})]}),"\n",(0,d.jsx)(r.O,{label:"适用版本",version:"Engula 2.2+",block:!0}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"engula-rdb 1\nsave 900 1\nsave 300 10\nsave 60 10000\n"})}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"engula-rdb 1"})," 会让本地 SAVE / BGSAVE 使用 Engula RDB。该模式主要用于集群节点都已切换为 Engula 后,提升 RDB SAVE / LOAD 等运维效率。迁移或回滚观察阶段,如果仍需要 Redis / Valkey 7.2 节点作为回退路径,建议使用兼容传统 RDB 的配置,待迁移完成后再评估是否启用。"]}),"\n",(0,d.jsx)(n.p,{children:"复制场景还会结合对端是否声明支持 Engula RDB 能力来决定是否回退传统 RDB;上线前仍建议在测试环境验证 SAVE / LOAD 与复制链路。"}),"\n",(0,d.jsxs)(n.h3,{id:"兼容传统-rdb",children:["兼容传统 RDB",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#兼容传统-rdb",children:"#"})]}),"\n",(0,d.jsx)(r.O,{label:"适用版本",version:"Engula 2.2+",block:!0}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"engula-rdb 0\n"})}),"\n",(0,d.jsx)(n.p,{children:"当需要把 RDB 交给原生 Redis / Valkey 工具、跨版本排查、对接尚未支持 Engula RDB 的链路,或迁移 / 回滚观察阶段仍保留 Redis / Valkey 7.2 节点时,使用传统 RDB 更稳妥。"}),"\n",(0,d.jsxs)(n.h3,{id:"限制-earena-写入范围",children:["限制 earena 写入范围",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#限制-earena-写入范围",children:"#"})]}),"\n",(0,d.jsx)(r.O,{label:"适用版本",version:"Engula 2.1+",block:!0}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"engula-enable-earena yes\nengula-earena-max-value-size 16777216\n"})}),"\n",(0,d.jsx)(n.p,{children:"超过阈值的大 value 会回退到普通对象存储。该配置适合在大 value 占比较高的场景中控制 earena 的适用范围。"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"engula-earena-max-value-size"})," 适用于 Engula 2.1 及以上版本;",(0,d.jsx)(n.code,{children:"engula-enable-earena"})," 和 ",(0,d.jsx)(n.code,{children:"engula-disable-*"})," 适用于 Engula 2.2 及以上版本。"]}),"\n",(0,d.jsxs)(n.h3,{id:"将-engula-用作缓存",children:["将 Engula 用作缓存",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#将-engula-用作缓存",children:"#"})]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-conf",children:"maxmemory 1gb\nmaxmemory-policy allkeys-lru\nappendonly no\n"})}),"\n",(0,d.jsx)(n.p,{children:"缓存模式使用的是 Redis 7.2 兼容配置。达到内存上限后,实例会按配置的淘汰策略释放 key。Engula 的 earena、压缩和 RDB 配置可以与缓存配置同时使用。"}),"\n",(0,d.jsxs)(n.h2,{id:"最佳实践",children:["最佳实践",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#最佳实践",children:"#"})]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["复用原 Redis / Valkey 配置时,先保持通用配置不变,只追加必要的 ",(0,d.jsx)(n.code,{children:"engula-*"})," 项。"]}),"\n",(0,d.jsxs)(n.li,{children:["每个实例使用独立的 ",(0,d.jsx)(n.code,{children:"dir"}),"、",(0,d.jsx)(n.code,{children:"logfile"}),"、",(0,d.jsx)(n.code,{children:"port"}),",避免复制或集群部署时互相覆盖。"]}
1),"\n",(0,d.jsx)(n.li,{children:"生产环境中不要依赖无配置文件启动;把配置纳入版本管理或配置管理系统。"}),"\n",(0,d.jsxs)(n.li,{children:["用 ",(0,d.jsx)(n.code,{children:"CONFIG GET <exact-name>"})," 检查 hidden config,不要用 ",(0,d.jsx)(n.code,{children:"CONFIG GET *"})," 判断 ",(0,d.jsx)(n.code,{children:"engula-*"})," 是否存在。"]}),"\n",(0,d.jsxs)(n.li,{children:["运行时打开 ",(0,d.jsx)(n.code,{children:"engula-disable-string"})," / ",(0,d.jsx)(n.code,{children:"engula-disable-set"})," / ",(0,d.jsx)(n.code,{children:"engula-disable-hash"}),"(Engula 2.2+)只影响后续写入,不会立即迁移已存在数据。"]}),"\n",(0,d.jsx)(n.li,{children:"涉及 RDB 格式、license、兼容等级的变更,建议先在测试实例上验证 SAVE / LOAD、复制和客户端行为。"}),"\n"]}),"\n",(0,d.jsxs)(n.h2,{id:"与-redis-72-配置的关系",children:["与 Redis 7.2 配置的关系",(0,d.jsx)(n.a,{className:"header-anchor","aria-hidden":"true",href:"#与-redis-72-配置的关系",children:"#"})]}),"\n",(0,d.jsxs)(n.p,{children:["Engula 的配置体系面向低成本迁移:当前版本主要兼容 Valkey 7.2 的配置参数;从 Redis 7.2 迁移时,通用配置通常可以按兼容语义理解。Engula 只在 ",(0,d.jsx)(n.code,{children:"engula-*"})," 命名空间增加自己的能力开关。"]}),"\n",(0,d.jsxs)(n.p,{children:["除本文明确列出的 Engula 专属项外,其余配置项、默认行为和调优方法请参考 ",(0,d.jsx)(n.a,{href:"https://valkey.io/topics/valkey.conf/",target:"_blank",rel:"noopener noreferrer",children:"Valkey 7.2 配置文档"}),";最终以目标 Engula 版本的配置文件为准。"]})]})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}=Object.assign({},(0,a.ah)(),e.components);return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(s,{...e})}):s(e)}let i=c;c.__RSPRESS_PAGE_META={},c.__RSPRESS_PAGE_META["zh%2Fdocs%2Fgetting-started%2Fconfiguration.mdx"]={toc:[{text:"配置文件",id:"配置文件",depth:2},{text:"指令格式",id:"指令格式",depth:2},{text:"命令行覆盖",id:"命令行覆盖",depth:2},{text:"运行时配置",id:"运行时配置",depth:2},{text:"版本化配置文件",id:"版本化配置文件",depth:2},{text:"常见配置场景",id:"常见配置场景",depth:2},{text:"最小单机实例",id:"最小单机实例",depth:3},{text:"使用 Engula RDB",id:"使用-engula-rdb",depth:3},{text:"兼容传统 RDB",id:"兼容传统-rdb",depth:3},{text:"限制 earena 写入范围",id:"限制-earena-写入范围",depth:3},{text:"将 Engula 用作缓存",id:"将-engula-用作缓存",depth:3},{text:"最佳实践",id:"最佳实践",depth:2},{text:"与 Redis 7.2 配置的关系",id:"与-redis-72-配置的关系",depth:2}],title:"Engula 配置指南",headingTitle:"Engula 配置指南",frontmatter:{}}},604:function(e,n,l){l.d(n,{O:()=>r});var d=l(2676),a=l(3238);function r(e){let{version:n,label:l="Applies to",block:r=!1,className:s}=e,c="string"==typeof l&&"string"==typeof n?`${l}: ${n}`:void 0;return(0,d.jsxs)("span",{className:(0,a.cn)("not-prose h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-line-2 bg-code-bg px-2 align-middle font-ui text-[11px] font-semibold leading-none text-text",r?"mb-3 mt-1 flex w-fit":"inline-flex",s),title:c,children:[(0,d.jsx)("span",{className:"text-muted",children:l}),(0,d.jsx)("span",{className:"h-3.5 w-px bg-line-2","aria-hidden":"true"}),(0,d.jsx)("span",{children:n})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.