如何修改Superset配置config.py以用于生产非开发环境。

huangapple go评论69阅读模式
英文:

How to change superset configuration config.py for production non-dev

问题

抱歉,以下是翻译好的部分:

抱歉,我为这个琐碎的问题感到抱歉...我已经阅读了手册并在互联网上搜索了答案。我能够使用使用用于开发目的的 docker-compose.yml 文件的 "docker-compose up" 更改 superset/config.py 文件的内容。主机 superset/config.py 文件的更改会部署到 superset_app 容器中。

但是,当我尝试使用以下命令启动 Superset 时:

docker-compose -f docker-compose-non-dev.yml up

主机 superset/config.py 文件的更改不会部署。

我可以怎么做呢?如果没有这个功能,那么没有办法设置重要的事项,如redis缓存、权限等等...在启动生产环境的Superset时,调整配置是否不可能?

我知道文档中说如果想查看Superset的配置更改,必须使用 docker-compose.yml...但是,在生产环境中部署Superset并仍然能够修改部署的 superset/config.py 文件的最佳方法是什么?

英文:

I'm sorry for this trivial question... I have read the manual and have searched the internet for an answer. I'm able to change the contents of the superset/config.py file using the "docker-compose up" that uses the docker-compose.yml file which is intended for development purposes. The changes in the host superset/config.py file get deployed to the container of superset_app.

But when I try to launch superset using

docker-compose -f docker-compose-non-dev.yml up

the changes to the host superset/config.py file don't get deployed.

What can I do? Without this, then there is no way to setup important things like redis cache, permissions, and much more... is it impossible to tune the configuration of Superset when launched for production?

I know the docs say that if one wants to view changes to Superset's configuration one must use docker-compose.yml... but what is the best way to deploy Superset for production and still being able to modify the deployed superset/config.py file?

答案1

得分: 1

典型的使用docker-compose部署时,不需要更改config.py,将其保留默认设置即可。相反,创建一个名为superset_config.pysuperset_config_docker.py的新文件,放在/docker/pythonpath_dev/目录中,并覆盖任何您想要更改的config.py中的值。请查看这个页面,它与文档的其余部分奇怪地分开了: https://github.com/apache/superset/tree/master/docker#configuration

至于为什么只有在开发docker-compose文件中才会生效更改config.py的问题,这是一个有趣的问题。我猜测问题可能出在两个文件的x-superset-volumes部分的不同之处。看起来开发文件将目录挂载为卷,而非开发文件则没有这样做?

英文:

The typical workflow when deploying with docker-compose is not to change config.py, leave that with its defaults. Instead, create a new file called superset_config.py or superset_config_docker.py - either should work - in the directory /docker/pythonpath_dev/ and override any values of config.py there that you want changed. See this page, which is oddly separate from the rest of the docs: https://github.com/apache/superset/tree/master/docker#configuration

As to why your changes to config.py get picked up with the dev docker-compose file only, that's an interesting question. My guess is the difference in the x-superset-volumes part of the two files. Looks like the dev file is mounting directories as volumes that the non-dev one isn't?

huangapple
  • 本文由 发表于 2023年6月12日 08:21:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76453016.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定