Skip to content
June edited this page Mar 23, 2017 · 5 revisions

You can specify infrasim node start [name] to start your node, while the [name] is by default a name of default. What's in runtime is:

  • infrasim gets the name default
  • infrasim finds a configuration in yml for this name, from either workspace, or configuration mapping
  • infrasim loads this yml and build workspace for this node if necessary
  • infrasim then start key components for this node

If you specify a name infrasim doesn't know, you will fail to start this node.

This article introduces how you manage your own configuration.

Introduction

Infrasim maintains you configuration in path ~/.infrasim/.node_map/. The file name, excluding the extention .yml, is your node name. So when you add a config for a node named mine, infrasim copy the config as ~/.infrasim/.node_map/mine.yml, and update the name attributes in yml to mine as well.

Infrasim will validate yaml file integrity and will refuse to manage the config if it's not valid on path or content.

Commands

Let's set node-1 as name and ~/new_config.yml as configuration in below examples.

Add configuration of your own

infrasim config add node-1 ~/new_config.yml

Add a config for the specified node node-1. If same name is already specified, infrasim will give a prompt to you that you need to call update commands.

Update configuration

infrasim config update node-1 ~/new_config.yml

Update a config for the specified name. If the name is not in management, infrasim will give a prompt to you that you need to call add commands.

Edit configuration

infrasim config edit node-1

A substitution of to update, you can directly edit configuration for an existing node node-1. This open an editor editing the corresponding configuration file. Editor depends on your shell environment EDITOR, but takes vi as default if you have not ever set EDITOR.

Apply new configuration

When you update a new configuration for node-1, you must want to start infrasim with this new config.

Please pay very attention here!

If you already have a node-1 in workspace ~/.infrasim/node-1, infrasim will start node-1 using the config in existing workspace. That's what we implement intentionally to prevent careless overwrite. To apply new config in this scenario, please destroy the node first by infrasim node destroy node-1, then start it by infrasim node start node-1

Delete configuration

infrasim config delete node-1

Delete ~/.infrasim/.node_map/node-1.yml