MemSQL Cluster Installation - changing the Data Directory

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

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>

1 Like

Hi Lucy

I have a 4 x nodes cluster of MemSQL 6.8 Community Edition on VM’s (1 MAgg, 1 CAgg, and 2 Leaves), that was installed with the default locations

I’m trying to move the data folder from the default location to a new location where I have 200GB space

I stopped all the nodes, and I start to get the MEMSQLID of the last Leaf:

memsql-admin describe-node --memsql-id 30C4748CB3 --property datadir

The path is: /var/lib/memsql/9a386e0b-9cfb-47d1-9977-b965aef070e5/data

cd /var/lib/memsql/9a386e0b-9cfb-47d1-9977-b965aef070e5/

sudo mv data /data/memsql

(/data folder is owned by memsql user as also the /memsql folder)

Then, when I run

memsql-admin update-config --memsql-id 30C4748CB3 --key datadir --value /data/memsql
or
memsql-admin update-config --memsql-id 30C4748CB3DF071D2235D9B2626F09BBCA7D2B6E --key datadir --value /data/memsql

I get the message

no node found with given prefix

I’m missing something here?

Thanks,
Adrian