Configuration FAQ
TigerGraph contains a complete configuration management solution through gadmin config
commands. These allow users to read and write configuration values. In a cluster, configuration commands only need to be run on one node - TigerGraph will handle propegating the configuration across the entire cluster.
How to change the root directory for temp/app/data
Recommended solution
-
Change the temp root directory
gadmin config set System.TempRoot /PATH/TO/DIRECTORY gadmin config apply -y gadmin restart all -y
-
Change the application root directory Note that this can also be used to switch between application binaries of the same minor version. For example, you may install 3.1.5 and switch the AppRoot back to 3.1.1 to go back to use 3.1.1 binaries. This provides a roll-back option when upgrading within the same minor version.
gadmin config set System.AppRoot /PATH/TO/DIRECTORY gadmin config apply -y gadmin restart all -y
-
Change the data root directory Changing the data root directory is a more involved process because data must also be moved in the directory. Please use caution when modifying anything in the data root.
#set the new directory you want to use and create it on all nodes in the cluster
NewDir=/PATH/TO/DIRECTORY
grun all "mkdir -p NEW_DIR"
#configure variables for use
OriginDataRoot=$(gadmin config get System.DataRoot)
newDataRoot=$NewDir
gstore_path=$OriginDataRoot/gstore
#convert links from absolute to relative
grun all "symlinks -rc $gstore_path/0/part"
#stop all TG services
gadmin stop all -y
#create a copy of the TigerGraph config
cp -L ~/.tg.cfg ~/.copy.tg.cfg
#make sure the new location exists
grun all "if [[ ! -f $newDataRoot && ! -d $newDataRoot ]]; then echo 'not exists'; else echo 'exists';
fi"
#move data from the old location to the new location on all nodes
grun all "mv $OriginDataRoot $newDataRoot"
#remove the old link and prepare the modified config
rm ~/.tg.cfg
cp -L ~/.copy.tg.cfg ~/.tg.cfg
gadmin config set System.DataRoot $newDataRoot --file ~/.tg.cfg
#start the cluster with the new config and remove the old copy
gadmin init cluster -y --skip-stop
rm ~/.copy.tg.cfg