В данном разделе описаны команды управления подсистемой распределенного хранилища - oasys.
Команды доступны для нод, использующих распределенное хранилище oasys - storage, mediator, sip, megaco.
<NODE> - имя ноды
backup
Команда создает резервную копию базы данных по указанному пути.
Путь команды:
/node/<NODE>/oasys/backup
Синтаксис:
backup <ExportPath>
Параметры:
<ExportPath> - путь, по которому будет создана резервная копия базы данных.
Пример:
admin@mycelium1@ecss1:/$ node/ds1@ecss1/oasys/backup /var/lib/ecss/backups/ Backup was successfully created at the path: "/var/lib/ecss/backups/Mnesia.ds1@ecss1_20210304085720"
export
Команда экспортирует таблицы баз данных oasys в каталог /var/lib/ecss/backups/backup_YYYY_MM_DD_HH_mm_SS.
Путь команды:
/node/<NODE>/oasys/export
Синтаксис:
export [<FLAGS>]
Параметры:
<FLAGS> - дополнительные действия, задаются опционально:
- --backup-dir <DIR> - задается путь относительно директории по умолчанию (/var/lib/ecss/backups) для сохранения конфигурации;
- --prefix <PREFIX> - задается префикс имени директории для сохранения конфигурации;
- --tables <NAME> - задается имя таблицы для экспорта;
- --tar - конфигурация сохраняется в tar.gz архиве;
- --storage-type <TYPE> - указывается тип хранилища для сохранения конфигурации:
- dets - сохранение конфигурации выполняется на диск, установлено по умолчанию.
Пример:
admin@mycelium1@ecss1:/$ node/md1@ecss2/oasys/export --backup-dir md2_backup Export table: alarms [**********************************************************************] 1s 30ms Tables are successfully exported to: /var/lib/ecss/backups/md2_backup/backup_2021_03_04_09_17_05
import
Команда импортирует таблицы баз данных oasys из каталога /var/lib/ecss/backups/backup_YYYY_MM_DD_HH_mm_SS.
Путь команды:
/node/<NODE>/oasys/import
Синтаксис:
import [<FLAGS>]
Параметры:
<FLAGS> - дополнительные действия, задаются опционально:
- --storage-type <TYPE> - указывается тип хранилища сохраненной конфигурации:
- dets - сохранение конфигурации выполняется на диск, установлено по умолчанию.
- --tables <NAME> - задается имя таблицы для экспорта;
- --tar <ARCHIVE> - имя tar-архива, в который сохранен файл конфигурации (путь относительно директории по умолчанию);
- --backup-dir <DIR> - имя директории, в которую сохранен файл конфигурации (если указана опция --tar, данный флаг игнорируется).
Пример:
admin@mycelium1@ecss1:/$ node/md1@ecss2/oasys/import --backup-dir md2_backup/backup_2021_03_04_09_17_05/ Import table: resourceLocationsTable [**********************************************************************] 1s 363ms Tables are successfully imported: alarms, statisticsManager, ituAlarmActiveTable, resourceInstancesTable, ituAlarmTable, alarmMasks, alarmsCleared, alarmActiveVariableTable, alarmActiveTable, alarmModelTable, resourceClassesTable, columnsMapping, alarmActiveStatsTable, alarmsIDTable, ituAlarmActiveStatsTable, alarmClearTable, resourceLocationsTable Total: 17
system-info
Команда отображает системную информацию распределенного хранилища. Можно просмотреть полную информацию или указать параметры, по которым будет выведена информация.
Путь команды:
/node/<NODE>/oasys/system-info
Синтаксис:
system-info [<COL1>, <COL2>, ...]
Параметры:
<COL_N> - название параметра, по которому будет показана информация. Опциональный параметр. При указании значения "all" будет показана полная информация: access_module; auto_repair; backup_module; checkpoints; db_nodes; debug; directory; dump_log_load_regulation; dump_log_time_threshold; dump_log_update_in_place; dump_log_write_threshold; event_module; extra_db_nodes; fallback_activated; held_locks; is_running; local_tables; lock_queue; log_version; master_node_tables; protocol_version; running_db_nodes; schema_location; subscribers; tables; transaction_commits; transaction_failures; transaction_log_writes; transaction_restarts; transactions; use_dir; version.
Show mnesia system information
Usage: system-info [<COL1>, <COL2>, ...]
<COL>:
- all. This argument returns a list of all local system information. Each element is a {InfoKey, InfoVal} tuples.Note: New InfoKey's may be added and old undocumented InfoKey's may be removed without notice.
- access_module. This argument returns the name of the module which is configured to be the activity access callback module.
- auto_repair. This argument returns true or false to indicate if Mnesia is configured to invoke the auto repair facility on corrupted disc files.
- backup_module. This argument returns the name of the module which is configured to be the backup callback module.
- checkpoints. This argument returns a list of the names of the checkpoints currently active on this node.
- event_module. This argument returns the name of the module which is the event handler callback module.
- db_nodes. This argument returns the nodes which make up the persistent database. Disc less nodes will only be included in the list of nodes if they explicitly has been added to the schema, e.g. with mnesia:add_table_copy/3. The function can be invoked even if Mnesia is not yet running.
- debug. This argument returns the current debug level of Mnesia.
- directory. This argument returns the name of the Mnesia directory. It can be invoked even if Mnesia is not yet running.
- dump_log_load_regulation. This argument returns a boolean which tells whether Mnesia is configured to load regulate the dumper process or not. This feature is temporary and will disappear in future releases.
- dump_log_time_threshold. This argument returns the time threshold for transaction log dumps in milliseconds.
- dump_log_update_in_place. This argument returns a boolean which tells whether Mnesia is configured to perform the updates in the dets files directly or if the updates should be performed in a copy of the dets files.
- dump_log_write_threshold. This argument returns the write threshold for transaction log dumps as the number of writes to the transaction log.
- extra_db_nodes. This argument returns a list of extra db_nodes to be contacted at start-up.
- fallback_activated. This argument returns true if a fallback is activated, otherwise false.
- held_locks. This argument returns a list of all locks held by the local Mnesia lock manager.
- is_running. This argument returns yes or no to indicate if Mnesia is running. It may also return starting or stopping. Can be invoked even if Mnesia is not yet running.
- local_tables. This argument returns a list of all tables which are configured to reside locally.
- lock_queue. This argument returns a list of all transactions that are queued for execution by the local lock manager.
- log_version. This argument returns the version number of the Mnesia transaction log format.
- master_node_tables. This argument returns a list of all tables with at least one master node.
- protocol_version. This argument returns the version number of the Mnesia inter-process communication protocol.
- running_db_nodes. This argument returns a list of nodes where Mnesia currently is running. This function can be invoked even if Mnesia is not yet running, but it will then have slightly different semantics. If Mnesia is down on the local node, the function will return those other db_nodes and extra_db_nodes that for the moment are up and running. If Mnesia is started, the function will return those nodes that Mnesia on the local node is fully connected to. Only those nodes that Mnesia has exchanged schema information with are included as running_db_nodes. After the merge of schemas, the local Mnesia system is fully operable and applications may perform access of remote replicas. Before the schema merge Mnesia will only operate locally. Sometimes there may be more nodes included in the running_db_nodes list than all db_nodes and extra_db_nodes together.
- schema_location. This argument returns the initial schema location.
- subscribers. This argument returns a list of local processes currently subscribing to system events.
- tables. This argument returns a list of all locally known tables.
- transactions. This argument returns a list of all currently active local transactions.
- transaction_failures. This argument returns a number which indicates how many transactions have failed since Mnesia was started.
- transaction_commits. This argument returns a number which indicates how many transactions have terminated successfully since Mnesia was started.
- transaction_restarts. This argument returns a number which indicates how many transactions have been restarted since Mnesia was started.
- transaction_log_writes. This argument returns a number which indicates the number of write operation that have been performed to the transaction log since start-up.
- use_dir. This argument returns a boolean which indicates whether the Mnesia directory is used or not. Can be invoked even if Mnesia is not yet running.
Примеры:
Вывести полную информацию:
Вывести информацию об узлах БД
admin@mycelium1@ecss1:/$ node/ds1@ecss1/oasys/system-info db_nodes ┌────────┬─────────┐ │ Name │ Value │ ├────────┼─────────┤ │db_nodes│ds1@ecss2│ │ │ds1@ecss1│ └────────┴─────────┘
table-info
Команда показывает системную информацию по определенной таблице распределенного хранилища.
Можно просмотреть полную информацию или указать параметры, по которым будет выведена информация.
Путь команды:
/node/<NODE>/oasys/table-info
Синтаксис:
table-info <TABLE_NAME> [<COL1>, <COL2>, ...]
Параметры:
<TABLE_NAME> - имя таблицы, по которой запрошена информация;
<COL_N> - название параметра, по которому будет показана информация. Опциональный параметр. Если не указывать параметр, будет показана полная информация: access_module; active_replicas; arity; attributes; checkpoints; cookie; disc_copies; disc_only_copies; index; load_node; load_order; load_reason; local_content; master_nodes; memory; ram_copies; record_name; size; snmp; storage_type; subscribers; type; user_properties; version; where_to_commit; where_to_read; where_to_write; wild_pattern.
Пример:
admin@mycelium1@ecss1:/$ node/sip1@ecss1/oasys/table-info mrm-sip-contact-biysk.local-table Table 'mrm-sip-contact-biysk.local-table' information ┌──────────────────┬────────────────────────────────────────────────────────────────────────────────┐ │ Name │ Value │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────────┤ │access_mode │read_write │ │active_replicas │sip1@ecss2 │ │ │sip1@ecss1 │ │all_nodes │[sip1@ecss2,sip1@ecss1] │ │arity │10 │ │attributes │contact │ │ │uri │ │ │type │ │ │ip_set │ │ │proto │ │ │text_contact │ │ │user │ │ │alias_number │ │ │sip_domain │ │checkpoints │[] │ │commit_work │[{subscribers,[],[<0.2609.0>]}] │ │cookie │{{1614775960950151892,-576460752303422047,1},sip1@ecss1} │ │cstruct │{cstruct,'mrm-sip-contact-biysk.local-table',set, │ │ │ [sip1@ecss2,sip1@ecss1], │ │ │ [],[],[],0,read_write,false,[],[],false,'mrm-sip-contact-row', │ │ │ [contact,uri,type,ip_set,proto,text_contact,user,alias_number, │ │ │ sip_domain], │ │ │ [{template_table,{'mrm-sip-contact',[]}},{version,"14.7.0.72554"}], │ │ │ [],[], │ │ │ {{1614775960950151892,-576460752303422047,1},sip1@ecss1}, │ │ │ {{3,0},{sip1@ecss2,{1614,827549,507396}}}} │ │disc_copies │ │ │disc_only_copies │ │ │external_copies │[] │ │frag_properties │[] │ │index │[] │ │index_info │{index,set,[]} │ │load_by_force │false │ │load_node │sip1@ecss1 │ │load_order │0 │ │load_reason │{dumper,create_table} │ │local_content │false │ │majority │false │ │master_nodes │ │ │memory │51728 │ │ram_copies │sip1@ecss2 │ │ │sip1@ecss1 │ │record_name │'mrm-sip-contact-row' │ │record_validation │{'mrm-sip-contact-row',10,set} │ │size │211 │ │snmp │[] │ │storage_properties│[] │ │storage_type │ram_copies │ │subscribers │[<0.2609.0>] │ │type │set │ │user_properties │[{template_table,{'mrm-sip-contact',[]}},{version,"14.7.0.72554"}] │ │version │{{3,0},{sip1@ecss2,{1614,827549,507396}}} │ │where_to_commit │[{sip1@ecss1,ram_copies},{sip1@ecss2,ram_copies}] │ │where_to_read │sip1@ecss1 │ │where_to_wlock │{[sip1@ecss1,sip1@ecss2],false} │ │where_to_write │[sip1@ecss1,sip1@ecss2] │ │wild_pattern │{'mrm-sip-contact-row','_','_','_','_','_','_','_','_','_'} │ └──────────────────┴────────────────────────────────────────────────────────────────────────────────┘
Добавить комментарий