首页 > 解决方案 > 墨盒实例.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

标签: tarantooltarantool-cartridge

解决方案


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:


推荐阅读