Objectivity/DB Spark Adapter : Advanced Topics : Scripts
Scripts
create_thingspan_fd.sh
 
(Linux only.) Creates a new federated database and sets up its storage locations for use by a Spark driver application executing in a cluster.
create_thingspan_fd.sh
[--placement-file filePath]
[--storage-location-args quotedOptions]
[--create-containers-args quotedOptions]
[--data-dir dirPath]
fdSysName
Options 
--placement-file filePath
(For advanced users.) Specifies a placement model document (PMD) to be imported into the new federated database.
--storage-location-args quotedOptions
(For advanced users.) String consisting of one or more options for the script to pass to the AddStorageLocation tool. The string must be enclosed in quotation marks. Within the string, individual options and their arguments must be separated by spaces.
The string can include any AddStorageLocation options other than -bootFile and -storageLocation, which are always provided by the script.
Note that options for AddStorageLocation are prefixed with a single hyphen.
--create-containers-args quotedOptions
(For advanced users.) String consisting of one or more options for the script to pass to the CreateContainers tool. The string must be enclosed in quotation marks. Within the string, individual options and their arguments must be separated by spaces.
The string must include any options required by CreateContainers (such as -count and -scope), but should not include -bootFile and -storageLocation, which are always provided by the script.
If you omit --create-containers-args, the script creates 100 containers per storage location in the scope of the default object placer.
Note that options for CreateContainers are prefixed with a single hyphen.
--data-dir dirPath
Path to a directory that exists on every host in the cluster. Each such directory is registered as a storage location in the new federated database’s main storage group (MSG).
If you omit this option, the script registers a default directory called installDir/data on each host, where installDir is the ThingSpan installation directory.
fdSysName
System name for the new federated database. fdSysName is used as the simple name of the boot file, and so must conform to your operating system’s naming rules for files, and must be between 1 and 127 characters long inclusive. The script passes fdSysName to CreateFd as the value of the -fdName option.
Discussion 
This script sets up storage for a Spark driver application executing in a cluster.
This script assumes that:
The cluster has been set up.
The lock server is running on master node.
You normally run this script on the master node of the cluster. You can run it on another host, provided that host has a valid Spark installation with the correct worker-node configuration, and has the SPARK_MASTER_IP environment variable set to identify the master node. (If this environment variable is not set, the script assumes the local host is the master node.)
The script performs the following tasks:
Identifies the master node of the cluster and obtains a list of the cluster’s worker nodes.
Calls CreateFd to create the federated database in a default storage location on the master node. The system database and boot file are created in this location, which is also set as the journal directory for the new federation.
Calls AddStorageLocation once for each worker node in the cluster to register the default storage location on that node.
Calls CreateContainers once for each worker node in the cluster to create new, empty data files to “seed” the data-file selection process.
The default storage location on every node in the cluster is the directory installDir/data where installDir is the ThingSpan installation directory. You can specify the --data-dir option to use a different directory.
Advanced users who are familiar with a federated database’s placement system can use the script’s other options to set up storage for a custom placement model.
See also 
Setting Up Storage on a Cluster
CreateFd
AddStorageLocation
CreateContainers