MemSQL Cluster Installation - changing the Data Directory


#1

Hi

I was installing MemSQL Cluster and plan to give a custom directory as Data Directory. I could not find the option to specify the custom directory (say in a Data Disk) while installation and I was following the instruction from the below URL’s

I have tried different tools and options and Both failed while updating/registering the configuration changes
a) memsql-admin update-config
b) changing the path in the memsql.conf file

Queries
a) is there any way/option to specify the data-directory while installation
b) is there any option to change the data-directory post installation

Regards
Madhu


#2

a) is there any way/option to specify the data-directory while installation

Yes. In the URL you linked, ignore the first part that tells you to run memsql-deploy setup-cluster... (this is a command that automates a lot of steps in a single command, but does not expose much ability to customize the deployment).

Instead, click on the blue text at the bottom that says “Manual Installation Steps” and try to follow that guide with the modification that everywhere the guide tells you to run
memsql-admin create-node --host <IP_address>

instead run:
memsql-admin create-node --host <IP_address> --datadir <PATH_TO_DATADIR>

where <PATH_TO_DATADIR> is the absolute path of the custom directory you would like to create (or an existing empty directory), on the host at <IP_address>.

b) is there any option to change the data-directory post installation

It is possible. Make sure the node is offline by running:

memsql-admin stop-node --memsql-id <MEMSQL_ID>

Then find the location of the current data directory by running:

memsql-admin describe-node --memsql-id <MEMSQL_ID> --property datadir.

Then, on the host that has the MemSQL node with MemSQL ID <MEMSQL_ID>, move the current data directory to its new path.

Then run:
memsql-admin update-config --memsql-id <MEMSQL_ID> --key datadir --value <NEW_PATH_TO_DATADIR>
where <NEW_PATH_TO_DATADIR> is the absolute path of the new location of the data directory, on the host for the MemSQL node with MemSQL ID <MEMSQL_ID>

Then start the node again:
memsql-admin start-node --memsql-id <MEMSQL_ID>