MarkLogic Server 11.0 Product Documentation
tieredstorage.partitionMigratetieredstorage.partitionMigrate(
database-id as (Number|String),
partition-name as String,
host-ids as (Number|String)[],
[data-directory as String?],
[large-data-directory as String?],
[fast-data-directory as String?],
[options as String[]]
) as null
Summary
This function migrates all forests in a partition to the specified data directory and hosts.
For details, see Migrating Forests and Partitions in the Administrator's Guide.
Parameters |
database-id |
ID of the database in which the partition will reside.
|
partition-name |
Name of the partition.
|
host-ids |
Ids of hosts on which the forests in the partition will be migrated to.
|
data-directory |
The optional data directory of the forest. If no directory
is specified, then it will be a private forest.
|
large-data-directory |
The optional directory where large objects are stored. If no directory
is specified, then large objects will be stored in
DATA_DIR/Forests/FOREST_NAME/Large.
|
fast-data-directory |
The optional directory for the fast data directory for this forest.
The fast data directory is typically located on a fast storage device,
such as an SSD.
|
options |
Valid option values include:
timeout=N - Specifies the number of seconds to wait for a forest to re-open after a
configuration is made during the migration operation.
local-to-local -
Indicates that the migration is between local storage to local storage.
This is the default when no other direction parameter is specified and
the type of storage cannot be derived from either the data directory
path.
local-to-shared -
Indicates that the migration is between local storage and shared
storage. This type of migration supports changing the host.
shared-to-local -
Indicates that the migration is to move data from shared storage to
local storage. This type of migration supports changing the host.
shared-to-shared -
Indicates that the migration is to move data from shared storage to
shared storage. This type of migration supports changing the host.
failover=[local, shared, none] -
If failover is set to
local and multiple hosts are specified,
any existing replica forests will be migrated and new replica forests will be
created, if no replica forests exist.
Shared disk failover will be set up if
failover is specified to be shared and multiple hosts are specified.
The failover hosts will be chosen to cover as many different zones as possible.
If failover is specified to be none , any existing replica forests will be
deleted.
If failover is left unspecified, and if local-disk failover is configured,
and if the data is being migrated to shared storage, the local disk replicas will be
removed, and shared-disk failover will be configured. If shared-disk failover is
configured and if the data is being migrated from shared storage to local storage, local-
disk failover will replace shared-disk failover. In all other scenarios, the
failover policy will be left unchanged when not specified.
replicas=N -
Specifies the number of replicas/failover hosts to maintain if failover.
|
Example
// Migrates all forests in the "2017-October" partition to the "/space/ts/" data directory
// on the local host.
const ts = require('/MarkLogic/tieredstorage');
declareUpdate();
ts.partitionMigrate(xdmp.database('Documents'), '2017-October', xdmp.host(), '/space/ts/');
Copyright © 2024 MarkLogic Corporation. MARKLOGIC is a
registered trademark of MarkLogic Corporation.