完全指南:结构与生成机制、users/databases/api-keys/settings 全量默认值速查)
Metabase 配置文件模板config-template完全指南结构与生成机制、users/databases/api-keys/settings 全量默认值速查【免费下载链接】metabaseThe easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:项目地址: https://gitcode.com/GitHub_Trending/me/metabase在 Metabase 中配置文件模板 是一份机器自动生成的 YAML 参考文档它把自托管版Pro/Enterprise启动时用于初始化实例的config.yml所需的全部结构——users、databases、api-keys与约三百个settings——连同默认值一次性列出是手工编写配置文件时最重要的标准答案。读完本文你将理解该模板如何随版本自动生成、每一节对应哪些初始化行为、{{ env ... }}模板语法如何被展开以及如何基于模板产出一份真正可用的config.yml。本文所有内容均以当前仓库中docs/configuring-metabase/目录下的文档与其 Clojure 源码为事实依据模板内容与仓库内该版本生成结果保持一致。这份模板是什么与哪些文档配套使用docs/configuring-metabase/config-template.md是 config-file.md配置文件文档的配套参考页。二者的分工是config-file.md 讲解config.yml的语义与规则放在哪里、分几个 section、env var 如何引用、特殊字符如何转义、加载时机等config-template.md 则直接给出模板本体一份带默认值的完整 YAML让使用者不必记忆任何键名。同时settings节中的键与 environment-variables.md 中MB_前缀的环境变量一一对应只是命名风格不同详见后文因此这两份文档经常配合查阅。模板开头用注释自述了它的定位这也正是使用它时的三条铁律# A config file template for Metabase. # Youll need to update (or remove) the users and databases sections. # The settings in settings include default values. We recommend removing # or commenting out settings that you dont set. # To use an env var, you can use a template string: {{ env YOUR_ENV_VAR }} # Note the quote marks wrapping the env var template.即users/databases必须改成你自己的账号与连接settings里包含默认值不打算设置的项应当删除或注释掉引用环境变量要写成带引号的{{ env YOUR_ENV_VAR }}。模板不是手写的一条命令生成与版本精确对齐的模板这份文档页是生成产物而非手写维护。模板页开头的说明明确给出了再生成命令clojure -M:doc:ee config-template在仓库根目录执行即可重新生成docs/configuring-metabase/config-template.md。其背后的生成器位于 src/metabase/cmd/config_file_gen.clj关键逻辑如下config-file-path定义为docs/configuring-metabase/config-template.md即本文档输出位置yaml-template指向基础模板资源 src/metabase/cmd/resources/config-template.yaml其中预置了示例users、databases与api-keys不含 settings生成器运行时通过dox/get-settings从当前代码库的 setting 注册表中取出全部可配置项过滤掉不应在配置文件中出现的设置只读:setter :none项、弃用项等后把每个 setting 的munged-name与其default注入 YAML 的config.settings节点并排序输出由于个别默认值在加载时无法通过校验例如saml-attribute-email的默认值是一个无法通过邮箱校验的链接settings-to-reset会把它们预先重置为nil最后用 intro/outro 两个 Markdown 资源把 YAML 包成页面并写盘。也就是说模板里每一个 settings 键及其默认值都来自代码中的 setting 注册表而非人工抄录因此它能随每个版本自动保持一致。这一点在源码层面可以验证模板与注册表之间没有硬编码的键表。完整模板原文含全量默认值下面是该文档当前版本的完整模板本体。编写config.yml时可以直接以此为起点复制修改# A config file template for Metabase. # Youll need to update (or remove) the users and databases sections. # The settings in settings include default values. We recommend removing # or commenting out settings that you dont set. # To use an env var, you can use a template string: {{ env YOUR_ENV_VAR }} # Note the quote marks wrapping the env var template. # For more on the configuration file, see: # https://www.metabase.com/docs/latest/configuring-metabase/config-file # For more on what each setting does, check out: # https://www.metabase.com/docs/latest/configuring-metabase/environment-variables version: 1 config: users: - first_name: First last_name: Person password: metabot1 email: firstexample.com - first_name: Normal last_name: Person password: metabot1 email: normalexample.com - first_name: Admin last_name: Person password: metabot1 is_superuser: true email: adminexample.com databases: - name: Sample PostgreSQL engine: postgres details: host: postgres-data port: 5432 user: metabase password: metasample123 dbname: sample - name: Sample MySQL engine: mysql details: host: mysql-data port: 3306 user: metabase password: metasample123 dbname: sample api-keys: - name: Admin API key group: admin creator: firstexample.com key: mb_firsttestapikey123 - name: All Users API key group: all-users creator: firstexample.com key: mb_secondtestapikey456 settings: admin-email: null aggregated-query-row-limit: null ai-features-enabled: true allowed-iframe-hosts: |- youtube.com, youtu.be, loom.com, vimeo.com, docs.google.com, calendar.google.com, airtable.com, typeform.com, canva.com, codepen.io, figma.com, grafana.com, miro.com, excalidraw.com, notion.com, atlassian.com, trello.com, asana.com, gist.github.com, linkedin.com, twitter.com, x.com analytics-pii-retention-enabled: false anon-tracking-enabled: true api-key: null application-colors: {} application-favicon-url: app/assets/img/favicon.ico application-font: Lato application-font-files: null application-logo-url: app/assets/img/logo.svg application-name: Metabase attachment-row-limit: null attachment-table-row-limit: 20 bcc-enabled: true breakout-bin-width: 10.0 breakout-bins-num: 8 check-for-updates: true config-from-file-sync-databases: true csp-img-allowed-hosts: csp-img-enabled: false csv-field-separator: , custom-formatting: {} custom-geojson: null custom-geojson-enabled: true custom-homepage: false custom-homepage-dashboard: null custom-viz-enabled: false dashboards-save-last-used-parameters: true db-connection-timeout-ms: 10000 db-query-timeout-minutes: 20 default-maps-enabled: true disable-auto-sync: false disable-cors-on-localhost: false download-row-limit: null email-from-address: notificationsmetabase.com email-from-address-override: notificationsmetabase.com email-from-name: null email-max-recipients-per-message: 50 email-max-recipients-per-second: null email-reply-to: null email-smtp-host: null email-smtp-host-override: null email-smtp-password: null email-smtp-password-override: null email-smtp-port: null email-smtp-port-override: null email-smtp-security: none email-smtp-security-override: ssl email-smtp-username: null email-smtp-username-override: null embedded-metabot-enabled: true embedding-app-origins-interactive: null embedding-app-origins-sdk: embedding-homepage: hidden embedding-secret-key: null enable-embedding-interactive: false enable-embedding-sdk: false enable-embedding-simple: false enable-embedding-static: false enable-password-login: true enable-pivoted-exports: true enable-public-sharing: true enable-xrays: true explorations-worker-count: 2 fingerprint-max-fields-per-table: 10000 follow-up-email-sent: false google-auth-auto-create-accounts-domain: null google-auth-client-id: null google-auth-enabled: null gsheets: null health-check-logging-enabled: true help-link: metabase help-link-custom-destination: https://www.metabase.com/help/premium hide-stacktraces: false http-channel-allowed-networks: external-only humanization-strategy: simple index-update-thread-count: 2 jdbc-data-warehouse-connection-pool-checkout-timeout-ms: 0 jdbc-data-warehouse-connection-pool-max-pending-checkouts: 0 jdbc-data-warehouse-max-connection-pool-size: 15 jdbc-network-timeout-ms: 1800000 jwt-attribute-email: email jwt-attribute-firstname: first_name jwt-attribute-groups: groups jwt-attribute-lastname: last_name jwt-attribute-tenant: tenant jwt-attribute-tenant-attributes: tenant.attributes jwt-enabled: false jwt-group-mappings: {} jwt-group-sync: false jwt-identity-provider-uri: null jwt-shared-secret: null jwt-user-provisioning-enabled: true landing-page: landing-page-illustration: default landing-page-illustration-custom: null ldap-attribute-email: mail ldap-attribute-firstname: givenName ldap-attribute-lastname: sn ldap-bind-dn: null ldap-enabled: false ldap-group-base: null ldap-group-mappings: {} ldap-group-membership-filter: (member{dn}) ldap-group-sync: false ldap-host: null ldap-password: null ldap-port: 389 ldap-security: none ldap-sync-user-attributes: true ldap-sync-user-attributes-allowlist: ldap-sync-user-attributes-blacklist: userPassword,dn,distinguishedName ldap-timeout-seconds: 15.0 ldap-trust-store: null ldap-user-base: null ldap-user-filter: ((objectClassinetOrgPerson)(|(uid{login})(mail{login}))) ldap-user-provisioning-enabled: true license-token-missing-banner-dismissal-timestamp: [] llm-anthropic-api-base-url: https://api.anthropic.com llm-anthropic-api-key: null llm-anthropic-model: claude-opus-4-5-20251101 llm-azure-api-base-url: null llm-azure-api-key: null llm-azure-deployment-name: null llm-azure-model-family: null llm-bedrock-access-key-id: null llm-bedrock-region: us-east-1 llm-bedrock-secret-access-key: null llm-bedrock-session-token: null llm-connection-timeout-ms: 10000 llm-deepseek-api-base-url: https://api.deepseek.com llm-deepseek-api-key: null llm-fast-mode: false llm-google-api-base-url: https://aiplatform.googleapis.com llm-google-location: null llm-google-oauth-access-token: null llm-google-project-id: null llm-google-service-account-key: null llm-max-tokens: 4096 llm-metabot-provider: anthropic/claude-sonnet-4-6 llm-mini-model: null llm-mistral-api-base-url: https://api.mistral.ai/v1 llm-mistral-api-key: null llm-moonshot-api-base-url: https://api.moonshot.ai/v1 llm-moonshot-api-key: null llm-openai-api-base-url: https://api.openai.com llm-openai-api-key: null llm-openai-model: gpt-5.4 llm-openrouter-api-base-url: https://openrouter.ai/api llm-openrouter-api-key: null llm-providers: [] llm-rate-limit-per-ip: 100 llm-rate-limit-per-user: 20 llm-request-timeout-ms: 120000 llm-vllm-api-base-url: null llm-vllm-api-key: null llm-vllm-request-timeout-ms: 300000 llm-zai-api-base-url: https://api.z.ai/api/paas/v4 llm-zai-api-key: null loading-message: doing-science login-page-illustration: default login-page-illustration-custom: null map-tile-server-allowed-networks: null map-tile-server-url: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png mcp-apps-cors-custom-origins: mcp-apps-cors-enabled-clients: [] metabot-advanced-permissions: false metabot-chat-system-prompt: metabot-enabled: true metabot-icon: metabot metabot-limit-reset-rate: monthly metabot-limit-unit: tokens metabot-name: Metabot metabot-nlq-system-prompt: metabot-quota-reached-message: You have reached your AI usage limit for the current period. Please contact your administrator. metabot-recent-views-enabled: true metabot-show-illustrations: true metabot-slack-signing-secret: null metabot-sql-system-prompt: mfa-challenge-signing-key: null mfa-enforcement: off native-query-autocomplete-match-style: substring nested-field-columns-value-length-limit: 50000 no-data-illustration: default no-data-illustration-custom: null no-object-illustration: default no-object-illustration-custom: null non-table-chart-generated: false not-behind-proxy: false notification-link-base-url: null notification-system-event-thread-pool-size: 5 notification-thread-pool-size: 3 oidc-allowed-networks: allow-all oidc-providers: [] oidc-user-provisioning-enabled: true persisted-model-refresh-cron-schedule: 0 0 0/6 * * ? * persisted-models-enabled: false premium-embedding-token: null query-caching-early-refresh-ratio: 0.1 query-caching-max-kb: 2000 query-caching-max-ttl: 3024000.0 queue-backend: null queue-max-retries: 5 queue-no-listener-max-age-ms: 86400000 redirect-all-requests-to-https: false remote-sync-auto-import: false remote-sync-auto-import-rate: 5 remote-sync-branch: null remote-sync-check-changes-cache-ttl-seconds: 60 remote-sync-git-timeout-seconds: 60 remote-sync-task-time-limit-ms: 300000 remote-sync-token: null remote-sync-transforms: false remote-sync-type: read-only remote-sync-url: null report-timezone: null reset-token-ttl-hours: 48 retry-initial-interval: 500 retry-jitter-factor: 0.1 retry-max-interval-millis: 30000 retry-max-retries: 6 retry-multiplier: 2.0 saml-application-name: Metabase saml-attribute-email: null saml-attribute-firstname: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname saml-attribute-group: null saml-attribute-lastname: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname saml-attribute-tenant: null saml-enabled: false saml-group-mappings: {} saml-group-sync: false saml-identity-provider-certificate: null saml-identity-provider-issuer: null saml-identity-provider-slo-uri: null saml-identity-provider-uri: null saml-keystore-alias: null saml-keystore-password: changeit saml-keystore-path: null saml-slo-enabled: false saml-user-provisioning-enabled: true scan-max-fields-per-table: 10000 scim-enabled: null sdk-encryption-validation-key: null search-language: null search-typeahead-enabled: true send-new-sso-user-admin-email: null session-cookie-samesite: lax session-cookies: false session-timeout: null setup-embedding-autoenabled: false setup-license-active-at-setup: false show-database-syncing-modal: null show-homepage-data: true show-homepage-xrays: true show-metabase-links: true show-static-embed-terms: true site-locale: en site-name: Metabase site-url: null slack-app-token: null slack-bug-report-channel: metabase-bugs slack-connect-attribute-team-id: https://slack.com/team_id slack-connect-authentication-mode: link-only slack-connect-client-id: null slack-connect-client-secret: null slack-connect-enabled: false slack-connect-signing-secret-version: 0 slack-connect-user-provisioning-enabled: true smtp-override-enabled: false source-address-header: X-Forwarded-For sql-jdbc-fetch-size: 500 sql-tools-parser-backend: sqlglot ssh-heartbeat-interval-sec: 180 start-of-week: sunday subscription-allowed-domains: null surveys-enabled: true sync-leaf-fields-limit: 1000 sync-max-fields-per-table: 10000 synchronous-batch-updates: false thread-interrupt-escalation-timeout-ms: 0 transform-run-job-sql-concurrency: 3 transform-timeout: 240 transforms-enabled: null unaggregated-query-row-limit: null uploads-settings: null usage-metadata-enabled: false usage-metadata-last-completed-day: null usage-metadata-retention-days: 90 usage-metadata-schedule: 0 0 2 * * ? * use-native-pivot-tables: false use-tenants: false user-visibility: all warehouse-allowed-networks: null顶层结构version与config模板最外层只有两个键version: 1 config: users: ... databases: ... api-keys: ... settings: ...version仅用于帮你管理自己的配置文件版本属于便利字段。但源码对版本有严格约束见下节。config真正的初始化内容内部可包含users、databases、api-keys、settings四个 section也可只写其中一部分。从实现层面看配置加载由企业版模块 enterprise/backend/src/metabase_enterprise/advanced_config/file.clj 驱动。该文件对配置文件做了版本协商version键是必须的Metabase 45 及以后只接受1.0到1.999之间的简单浮点版本号不采用语义化版本这样将来若要加入向后兼容的新字段可定义1.1、1.2若要引入破坏性变更则升级到2.0新旧版本之间不会莫名其妙地崩掉。同时每个 section 的内容在模板展开前都会先做 spec 校验以避免敏感值如密码出现在错误日志里。users 小节账号初始化与管理员判定规则users下每个元素是一个用户账号users: - first_name: First last_name: Person password: metabot1 email: firstexample.com - first_name: Admin last_name: Person password: metabot1 is_superuser: true email: adminexample.com规则要点来自 config-file.md一个 Metabase 实例的第一个用户会自动成为管理员。因此users列表中的第一个账号若实例尚未完成首次设置会自动成为 admin若实例已设置过首个用户已存在则该账号按普通用户加载。想要显式指定管理员用is_superuser: true注意字段名与某些外部目录服务中的拼写习惯不同。密码只支持明文写入可结合下文的{{ env ... }}模板把明文挪到环境变量里避免密码硬编码在 YAML 中。databases 小节数据库连接与 uploads 配置databases下每个元素是一条连接模板里给了 PostgreSQL 与 MySQL 两个样例databases: - name: Sample PostgreSQL engine: postgres details: host: postgres-data port: 5432 user: metabase password: metasample123 dbname: samplename连接在 Metabase 中显示的名称engine数据库驱动标识如postgres、mysql、h2等details连接参数。可以指定哪些键以 Metabase 界面中对应数据库的字段为准即添加到连接页面看到什么字段这里就能写什么字段。databases元素还可以带上 uploads 相关配置参见 uploadsdatabases: - name: test-data (Postgres) engine: postgres details: host: localhost port: 5432 user: dbuser password: {{ env POSTGRES_TEST_DATA_PASSWORD }} dbname: test-data uploads_enabled: true uploads_schema_name: uploads uploads_table_prefix: uploads_三个键的含义uploads_enabledBoolean是否允许向该数据库上传文件uploads_schema_nameString上传表所在 schemauploads_table_prefixString上传表的前缀。api-keys 小节通过配置文件预置稳定 API Keyapi-keys用于在自动化部署中创建 API Key保证不同环境间的 Key 稳定一致。模板样例api-keys: - name: Admin API key group: admin creator: firstexample.com key: mb_firsttestapikey123 - name: All Users API key group: all-users creator: firstexample.com key: mb_secondtestapikey456使用规则同样整理自 config-file.md 并已在实现中体现key的格式mb_前缀 字母数字////字符即须满足正则mb_[A-Za-z0-9/]最短 12 字符、最长 254 字符。可用命令生成echo mb_$(openssl rand -base64 32)例如得到mb_aDqk1Tc4ZotWb2TyjHY71glALKlBg75dLgmSufWGLc。也可以直接把 key 交给环境变量api-keys: - name: ENV API Key key: {{env API_KEY_FROM_ENV}} creator: adminexample.com group: admincreator必须是管理员要么实例中已存在至少一个 admin要么在users节中创建带is_superuser: true的账号。group只允许两个值admin或all-users——因为这是 Metabase 始终会初始化的两个内置组。Key 的实际权限取决于其所属group而不是creator。同名不覆盖如果已存在同名的 API Key例如在 UI 中重新生成过加载配置文件时会保留现有 Key不会用文件里的key覆盖——这意味着文件里的 key 会失效。要强制覆盖需先在 API Keys 文档 所述操作中删除旧 Key要同时保留则需改名。注意settings里那个api-key: null不是用来创建 API Key 的它只用于/notify端点请求头的字符串匹配鉴权。settings 小节全量管理设置与默认值settings是模板中体量最大的部分模板页注释要求它带的是默认值没打算改的项应删除或注释。这样做的原因与配置文件语义直接相关详见 config-file.mdMetabase 每次重启并加载配置文件时配置文件中的设置会覆盖你在 Metabase UI 里对这些设置做过的任何修改。因此把不相关的项留在文件里等于把它们的值钉死为文件中的默认值UI 改动在重启后会被覆盖。键名与MB_环境变量的换算规则settings中的键与 environment-variables.md 一一对应只是命名风格不同环境变量为全大写下划线 MB_前缀MB_NAME_OF_VARIABLE配置文件中为小写连字符name-of-variable例如要设置MB_EMAIL_FROM_NAME在config.yml中写作version: 1 config: settings: email-from-name: Stampy von Mails-a-lot注意与真正环境变量的优先级差异配置文件设置不算硬编码来源UI 中仍可修改而由环境变量设置的项在 UI 中无法改动。二者加载顺序与覆盖关系在 environment-variables.md 中有更完整的说明。按功能域解读默认值模板中数百个设置可粗略划分为以下几组键名均为上表原文便于检索站点与外观site-name/site-url/site-locale/report-timezone/start-of-week、application-name/application-font默认Lato/application-colors/application-logo-url/application-favicon-url、loading-message默认doing-science、landing-page、login-page-illustration、no-data-illustration等。行数/导出限制aggregated-query-row-limit、unaggregated-query-row-limit、download-row-limit均为null表示不限制、csv-field-separator,、attachment-table-row-limit20、enable-pivoted-exports、sql-jdbc-fetch-size500等。查询与数据库行为db-connection-timeout-ms10000、db-query-timeout-minutes20、jdbc-network-timeout-ms1800000、jdbc-data-warehouse-max-connection-pool-size15、breakout-bin-width10.0、breakout-bins-num8、native-query-autocomplete-match-style、sql-tools-parser-backendsqlglot、humanization-strategysimple、nested-field-columns-value-length-limit50000。同步/指纹/缓存disable-auto-sync、scan-max-fields-per-table/sync-max-fields-per-table/fingerprint-max-fields-per-table10000、sync-leaf-fields-limit1000、config-from-file-sync-databasestrue、query-caching-max-kb2000、query-caching-max-ttl、query-caching-early-refresh-ratio0.1。邮件与订阅通知email-from-address、email-smtp-*一组默认多数为nullemail-smtp-security默认none、email-max-recipients-per-message50、bcc-enabled、subscription-allowed-domains、notification-*等。登录与 SSOenable-password-login、google-auth-*、jwt-*jwt-enabled默认false属性映射键如jwt-attribute-email: email、ldap-*ldap-port: 389、ldap-security: none、saml-*、oidc-*、scim-enabled、mfa-enforcementoff、session-cookie-samesitelax、session-cookies、session-timeout、reset-token-ttl-hours48。嵌入Embeddingenable-embedding-interactive/enable-embedding-sdk/enable-embedding-simple/enable-embedding-static均默认false、embedding-secret-key、embedding-app-origins-*、embedding-homepagehidden、setup-embedding-autoenabled、premium-embedding-token。分享与探索enable-public-sharing、enable-xrays、show-homepage-data/show-homepage-xrays、custom-homepage/custom-homepage-dashboard、custom-viz-enabled、use-native-pivot-tables。安全与网络csp-img-enabled/csp-img-allowed-hosts、allowed-iframe-hosts模板里给出了一长串默认白名单含 youtube、figma、notion 等以 YAML 块标量|-形式给出、http-channel-allowed-networksexternal-only、map-tile-server-url/map-tile-server-allowed-networks、source-address-headerX-Forwarded-For、redirect-all-requests-to-https、not-behind-proxy、show-metabase-links、hide-stacktraces、help-link。AI / Metabot / LLMai-features-enabled、metabot-enabledtrue、metabot-name、embedded-metabot-enabled、llm-providers空数组、llm-openai-*、llm-anthropic-*、llm-google-*、llm-azure-*、llm-bedrock-*等一系列 base-url/api-key/model 配置以及llm-max-tokens4096、llm-rate-limit-per-ip100、llm-rate-limit-per-user20等限流项。模型持久化 / 远程同步 / 转换persisted-models-enabled、persisted-model-refresh-cron-schedule、remote-sync-*一组remote-sync-type默认read-only、transforms-enabled/transform-*。分析/遥测/用量元数据anon-tracking-enabledtrue、analytics-pii-retention-enabled、usage-metadata-enabled、usage-metadata-retention-days90、surveys-enabled、check-for-updates。任务队列与重试queue-backend/queue-max-retries/queue-no-listener-max-age-ms、retry-*一组指数退避参数retry-multiplier: 2.0、retry-max-retries: 6等、explorations-worker-count、index-update-thread-count。Slack 集成slack-app-token、slack-bug-report-channel、slack-connect-*一组。多租户/仓库warehouse与 MCPuse-tenants、warehouse-allowed-networks、mcp-apps-cors-*等。杂项admin-email、user-visibilityall、uploads-settings、gsheets、search-typeahead-enabled、google/landing 等页面插图开关等。完整的键与默认值以上面的全量模板为准想了解每个键的语义应以 environment-variables.md 中的同名条目为权威解释。配置文件中的模板语法与转义模板注释与 config-file.md 都强调两种写法引用环境变量{{ env YOUR_ENV_VAR }}。必须带引号否则 YAML 解析器不会把它识别成字符串模板Metabase 也就无法替换成环境变量值。不支持递归展开——即环境变量的值里再引用另一个环境变量是行不通的。字面量中含花括号若某个值本身包含}}或{{需要用三重大括号包裹以表示按字面值处理。例如密码MetaPa$$123{{要写作password: {{{ MetaPa$$123{{ }}}在实现上模板展开复用了解析 SQL 查询参数的同一套代码参数解析模块。{{env BIRD_TYPE}}这类形式会被解析并分派到对应的展开函数当前仅支持env模板类型且展开发生在每个 section 的 spec 校验之后从而避免校验报错时泄露敏感值。从模板到一份可用的 config.yml结合 config-file.md把模板变成实际配置文件的操作路径如下。存放位置二选一当前目录运行 Metabase JAR 的目录下名为config.yml或config.yaml或由环境变量MB_CONFIG_FILE_PATH指定的路径。让设置生效前的纪律凡是写进文件的 settingsMetabase 每次重启加载时都会用它覆盖 UI 中的对应改动因此建议只保留真正要固定下来的设置。针对数据模型从序列化导出导入的场景可在加载时禁用初始数据库同步避免 scheduler 立刻去 sync。把config-from-file-sync-databases: false放进settings且必须位于databases列表之前version: 1 config: settings: config-from-file-sync-databases: false databases: - name: my-database engine: postgres details: ...注意模板中该键的默认值为true正式使用时按需调整。启动一个新实例配置文件加载属于自托管 Pro/Enterprise 功能新装实例需要先通过环境变量MB_PREMIUM_EMBEDDING_TOKEN提供 license tokenMB_PREMIUM_EMBEDDING_TOKEN[your token] java --add-opens java.base/java.nioALL-UNNAMED -jar metabase.jar进一步阅读在仓库内可以继续深入这些资料配置文件完整语义config-file.md每个 setting 的释义与MB_环境变量说明environment-variables.md模板生成器源码src/metabase/cmd/config_file_gen.clj其基础 YAML 资源在 src/metabase/cmd/resources/config-template.yaml配置加载/校验/模板展开实现enterprise/backend/src/metabase_enterprise/advanced_config/file.cljusers、databases、api-keys三个 section 的初始化逻辑分别位于同目录的users.clj、databases.clj、api_keys.clj掌握模板可再生成、键值源自注册表、重启即以文件覆盖 UI、{{ env }}必须加引号这几个要点你就能把 Metabase 的初始化配置做成可复现、可审计、跨环境稳定的部署资产。【免费下载链接】metabaseThe easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:项目地址: https://gitcode.com/GitHub_Trending/me/metabase创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考