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>
memsql-admin create-node --host <IP_address> --datadir <PATH_TO_DATADIR>
<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
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.
memsql-admin update-config --memsql-id <MEMSQL_ID> --key datadir --value <NEW_PATH_TO_DATADIR>
<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
Then start the node again:
memsql-admin start-node --memsql-id <MEMSQL_ID>