tarantool - 墨盒实例.yml 文件
问题描述
这些字段是什么意思,我应该为我的应用程序放什么?
cartridge:
cluster_cookie: ""
replication_connect_quorum: 1
cartridge.srv-1:
workdir: dev/3301
advertise_uri: localhost:3301
http_port: 8081
------ stripped ------
cartridge-stateboard:
workdir: ./dev/stateboard
password: qwerty
listen: 4401
解决方案
Cartridge has 2 types of configuration:
- per-instance, meaning that the configuration can be only seen by the specific instance
- clusterwise, that is shared by all instances
What you have here in instances.yml
file is the per-instance configuration. You'd want to use it for parameters that differ instance-by-instance. For example, listen ports, or the amount of memory a specific instance will get.
You can also see that the top-level section in the instances.yml contains app name and instance name separated by a dot. This is how an instance decides which part of this configuration to load. It will search itself in the top-level section and only load the relevant piece (in your example it's cartridge.srv-1
). There is also a way to specify configuration for all instances of an app. In this case, omit the instance name (like cartridge
in your example). Then, every instance of the app named cartridge
will load those parameters as well.
As to what parameters can be specified, there are 3 types:
- All box.cfg parameters such as
memtx_memory
orwal_mode
are supported. You can pass them with their original name. - Cartridge-specific parameters such as
http_port
oradvertise_uri
. You can find the list here. - Custom parameters specific for your app. See this answer: How I can to get custom options in the `init` function of the Tarantool Cartridge role?
推荐阅读
- amazon-cloudfront - 修复使用 Lambda@Edge 处理漂亮 URL 时的 Cloudfront 403 Access Denied 请求错误
- ios - swift中CACornerMask和UIRectCorner的区别
- node.js - Mongoose:使用“1”作为 Schema.Types.ObjectId 的值创建模型
- javascript - 达到 100% 后无法在 React 中重新加载进度条
- pandas - Pandas:如何对数据框中的一系列列进行排序?
- c# - 可以在覆盖方法中撤销必需属性吗?
- python - Pandas:从 github 读取 csv
- javascript - Javascript:在箭头函数中声明的变量不能在while循环中更新
- python - Django,在上传时重命名图像文件
- ios - 当应用程序再次启动(Swift)时,如何加载存储在数组中的所有数据?