Fabric Basics - Getting Started

Start and Stop Fabric Commands

Run the following commands through the Fabric server command line:

Command Name

Command Description

k2fabric start

Start the Fabric node. Fabric displays notifications when local files are in conflict with the installed release (private files). Always start the seed nodes before other nodes in the Fabric cluster.

k2fabric stop

Stop the Fabric node.

k2fabric restart

Restart (stop and start) the Fabric node.

k2fabric watchdog

Keeps a specific command alive in case of failure. The specific command to be kept alive is input to the watchdog function. The number of retries and the grace period are also configurable.

Get Fabric Version

Run the k2fabric -version script through the Fabric server command line to get the version of Fabric installed on your server. Note that you can check the Fabric version of your server in Fabric using the VERSION INFO Fabric command.

Login Fabric

Enter Fabric From the Fabric Server

Type fabric in the Fabric server command line.

Enter the Fabric Debug Server

Fabric Studio Debug Panel can be used to start, stop and open the Fabric Console of the Fabric debug server.

Reset Fabric

The Fabric reset.sh script cleans Fabric and deletes (drops) all data from Fabric and Cassandra. The reset.sh script is located under $K2_HOME/fabric/scripts and is used mainly:

  • In a Test environment to delete the current data and to restart the testing process from scratch.

  • In a Production environment. Note that the DROP LUTYPE command and the reset.sh script are rarely used in a Production environment. A possible scenario for using these processes is to clean an environment after a soft launch prior to starting an actual Production run.

Unlike the drop LU (DROP LUTYPE) command which drops a specific LU, the reset.sh script performs a full Fabric initialization, including deleting users, tokens, metadata, data and also deletes the data from Cassandra.

The Drop process must be followed by the re-creation of Fabric credentials and redeployment of the project implementation into the Fabric server and an initial load of LUI into the re-deployed LUs.

Note that the Windows version of the $K2_HOME/fabric/scripts Reset script is reset.bat.

Run the script from $K2_HOME/fabric/scripts directory:

  • ./reset.sh <mode><black_list><path of config.ini file>

Reset.sh Parameters

Parameter Name

Mandatory

Description

Mode

Yes

Reset mode. The following modes are supported:

  • drop, removes Fabric storage from the local Fabric node, Kafka topics, and all Cassandra Fabric-related keyspaces except for keyspaces set in the black-list parameter if set.
  • drop_all, removes Fabric storage on the local Fabric node, Kafka topics, and all Cassandra Fabric-related keyspaces except the keyspaces set in the black-list parameter and system keyspaces.
  • drop_local, removes Fabric storage on the local Fabric node only. For example, remove /dev/shm/ directory on the local node.

Black-list

No

List of Cassandra Fabric-related keyspaces or Kafka topic names that must be excluded from the drop.

The names have double quotes and are separated by a space.

Path

No

Config.ini file path.

 

Run Reset.sh On a Fabric Cluster

When a Fabric cluster clean-up is required, it is recommended to execute the reset.sh script in the following order:

  • Run on one node, ./reset.sh drop_all; - cleans Fabric storage on the local Fabric node and removes Cassandra keyspaces and Kafka topics. Removing Cassandra keyspaces and Kafka topics impacts the entire Fabric cluster.

  • Run on all other nodes, ./reset.sh drop_local; - cleans Fabric storage on the local Fabric node. To reset the Fabric cluster correctly, execute the reset.sh script on all fabric nodes, and only then start each Fabric node individually.

Reset Fabric - Remove Fabric Directories

The reset.sh script gets the list of the Fabric directories to be removed from the config.ini configuration file. The following parameters are checked to get the list of removed Fabric directories:

Parameter Name

Parameter Description

Default Value

MDB_COMMONS_PATH

Common (reference) tables storage directory.

${FABRIC_HOME}/storage/common

STORAGE_DIR

Fabric storage directory.

${FABRIC_HOME}/storage

MDB_DEFAULT_CACHE_PATH

Directory holding cached database files of LU Instances.

/dev/shm/fdb_cache

WEBSERVER_DIR

Home directory of the Fabric Web Admin. Can also contain manipulations (rewrites) on the URL when invoking Fabric Web Services.

${FABRIC_HOME}/webserver

Watchdog (available from Fabric 6.4.5)

The Fabric watchdog.sh script is used to keep a specific command alive. The script is located under $K2_HOME/fabric/scripts.

Script flow:

  1. Execute the command that is input to the function. Watchdog will run on Fabric by default if a specific command is not provided.

  2. Restart the command upon failure automatically according to the number of retries, during the grace period. The number of retries and the grace period are configurable.

Note: watchdog script can monitor only commands that are not running in the background.

Script syntax:

./watchdog.sh [-r=WATCHDOG_MAX_RETRIES] [-g=WATCHDOG_VERIFICATION_GRACE_SEC]

: The command that must be kept alive.

WATCHDOG_MAX_RETRIES [optional (default=3)]: The watchdog will try to execute the provided command upon failure, up to this number of attempts. This parameter is configured using the -r option or as an environment variable.

WATCHDOG_VERIFICATION_GRACE_SEC [optional (default=60)]: A verification grace period (in seconds) during which the service tries to execute the provided command. It tries to do this WATCHDOG_MAX_TRIES attempts . If, by the time the grace period expires, the executed command has failed, the counter is reset. This parameter is configured using the -g option or as an environment variable.

Example

./watchdog.sh 'cassandra.sh -f' -r=4 -g=80

​ run a watchdog on cassandra. During a grace period of 80 seconds, try to run cassandra.sh 4 times.

Kill Watchdog (available from Fabric 6.4.5)

The Fabric watchdog-kill.sh script is used kill (stop) a watchdog process and its child processes. The script is located under $K2_HOME/fabric/scripts.

Script flow:

  1. Kill the watchdog and child process.

Script syntax:

./watchdog-kill.sh

- the id of the watchdog (and its child processes) that is to be killed

Example

./watchdog-kill.sh 1234

​ Kill process id 1234, can be either the watchdog process id or the child process id. Both processes will be killed.

Previous

Fabric Basics - Getting Started

Start and Stop Fabric Commands

Run the following commands through the Fabric server command line:

Command Name

Command Description

k2fabric start

Start the Fabric node. Fabric displays notifications when local files are in conflict with the installed release (private files). Always start the seed nodes before other nodes in the Fabric cluster.

k2fabric stop

Stop the Fabric node.

k2fabric restart

Restart (stop and start) the Fabric node.

k2fabric watchdog

Keeps a specific command alive in case of failure. The specific command to be kept alive is input to the watchdog function. The number of retries and the grace period are also configurable.

Get Fabric Version

Run the k2fabric -version script through the Fabric server command line to get the version of Fabric installed on your server. Note that you can check the Fabric version of your server in Fabric using the VERSION INFO Fabric command.

Login Fabric

Enter Fabric From the Fabric Server

Type fabric in the Fabric server command line.

Enter the Fabric Debug Server

Fabric Studio Debug Panel can be used to start, stop and open the Fabric Console of the Fabric debug server.

Reset Fabric

The Fabric reset.sh script cleans Fabric and deletes (drops) all data from Fabric and Cassandra. The reset.sh script is located under $K2_HOME/fabric/scripts and is used mainly:

  • In a Test environment to delete the current data and to restart the testing process from scratch.

  • In a Production environment. Note that the DROP LUTYPE command and the reset.sh script are rarely used in a Production environment. A possible scenario for using these processes is to clean an environment after a soft launch prior to starting an actual Production run.

Unlike the drop LU (DROP LUTYPE) command which drops a specific LU, the reset.sh script performs a full Fabric initialization, including deleting users, tokens, metadata, data and also deletes the data from Cassandra.

The Drop process must be followed by the re-creation of Fabric credentials and redeployment of the project implementation into the Fabric server and an initial load of LUI into the re-deployed LUs.

Note that the Windows version of the $K2_HOME/fabric/scripts Reset script is reset.bat.

Run the script from $K2_HOME/fabric/scripts directory:

  • ./reset.sh <mode><black_list><path of config.ini file>

Reset.sh Parameters

Parameter Name

Mandatory

Description

Mode

Yes

Reset mode. The following modes are supported:

  • drop, removes Fabric storage from the local Fabric node, Kafka topics, and all Cassandra Fabric-related keyspaces except for keyspaces set in the black-list parameter if set.
  • drop_all, removes Fabric storage on the local Fabric node, Kafka topics, and all Cassandra Fabric-related keyspaces except the keyspaces set in the black-list parameter and system keyspaces.
  • drop_local, removes Fabric storage on the local Fabric node only. For example, remove /dev/shm/ directory on the local node.

Black-list

No

List of Cassandra Fabric-related keyspaces or Kafka topic names that must be excluded from the drop.

The names have double quotes and are separated by a space.

Path

No

Config.ini file path.

 

Run Reset.sh On a Fabric Cluster

When a Fabric cluster clean-up is required, it is recommended to execute the reset.sh script in the following order:

  • Run on one node, ./reset.sh drop_all; - cleans Fabric storage on the local Fabric node and removes Cassandra keyspaces and Kafka topics. Removing Cassandra keyspaces and Kafka topics impacts the entire Fabric cluster.

  • Run on all other nodes, ./reset.sh drop_local; - cleans Fabric storage on the local Fabric node. To reset the Fabric cluster correctly, execute the reset.sh script on all fabric nodes, and only then start each Fabric node individually.

Reset Fabric - Remove Fabric Directories

The reset.sh script gets the list of the Fabric directories to be removed from the config.ini configuration file. The following parameters are checked to get the list of removed Fabric directories:

Parameter Name

Parameter Description

Default Value

MDB_COMMONS_PATH

Common (reference) tables storage directory.

${FABRIC_HOME}/storage/common

STORAGE_DIR

Fabric storage directory.

${FABRIC_HOME}/storage

MDB_DEFAULT_CACHE_PATH

Directory holding cached database files of LU Instances.

/dev/shm/fdb_cache

WEBSERVER_DIR

Home directory of the Fabric Web Admin. Can also contain manipulations (rewrites) on the URL when invoking Fabric Web Services.

${FABRIC_HOME}/webserver

Watchdog (available from Fabric 6.4.5)

The Fabric watchdog.sh script is used to keep a specific command alive. The script is located under $K2_HOME/fabric/scripts.

Script flow:

  1. Execute the command that is input to the function. Watchdog will run on Fabric by default if a specific command is not provided.

  2. Restart the command upon failure automatically according to the number of retries, during the grace period. The number of retries and the grace period are configurable.

Note: watchdog script can monitor only commands that are not running in the background.

Script syntax:

./watchdog.sh [-r=WATCHDOG_MAX_RETRIES] [-g=WATCHDOG_VERIFICATION_GRACE_SEC]

: The command that must be kept alive.

WATCHDOG_MAX_RETRIES [optional (default=3)]: The watchdog will try to execute the provided command upon failure, up to this number of attempts. This parameter is configured using the -r option or as an environment variable.

WATCHDOG_VERIFICATION_GRACE_SEC [optional (default=60)]: A verification grace period (in seconds) during which the service tries to execute the provided command. It tries to do this WATCHDOG_MAX_TRIES attempts . If, by the time the grace period expires, the executed command has failed, the counter is reset. This parameter is configured using the -g option or as an environment variable.

Example

./watchdog.sh 'cassandra.sh -f' -r=4 -g=80

​ run a watchdog on cassandra. During a grace period of 80 seconds, try to run cassandra.sh 4 times.

Kill Watchdog (available from Fabric 6.4.5)

The Fabric watchdog-kill.sh script is used kill (stop) a watchdog process and its child processes. The script is located under $K2_HOME/fabric/scripts.

Script flow:

  1. Kill the watchdog and child process.

Script syntax:

./watchdog-kill.sh

- the id of the watchdog (and its child processes) that is to be killed

Example

./watchdog-kill.sh 1234

​ Kill process id 1234, can be either the watchdog process id or the child process id. Both processes will be killed.

Previous