Memsql-deploy cluster-in-a-box fails

Hello team,

memsql-deploy cluster-in-a-box --license LICENSE fails with

error running memsqlctl: error running command: `"/usr/bin/sudo" "-S" "-k" "--" "/bin/sh" "-c" "'printf' '87793e3c-c202-4c2a-a527-0aa68b07631c' && 'exec' 'memsqlctl' '--json' '--yes' 'create-node' '--port' '3306' '--secure-password' 'ASECUREPASSWORD '--timeout' '60s'"`: exit status 1
stderr: [sudo] password for admin: Latest errors from MemSQL tracelog:
97 2019-12-10 22:58:26.698 INFO: Log opened
: Failed to connect to MemSQL: Could not establish connection: Error 1045: Access denied for user 'root'@'localhost' (using password: NO)

I also have mysqld running on 3306 and have read the other solved thread about this but memsql support told me that running memsql on port 3306 is just fine because MySQL and MemSQL are wire compatible.

What I want to achieve is running MemSQL and MySQL together and use the mysql driver to connect to MemSQL, so I can use MemSQL database for wordpress websites.

Hi @chwba,

MySQL and MemSQL can run alongside without an issue if they use different ports.

You might be hitting an issue when both MySQL and MemSQL try to use the same port (3306).
On Linux only one process can listen on a port. If mysql is using 3306, MemSQL cannot use the port.

If that is the case, this is a confusing error message that we’ll likely fix soon.

You can use netstat -tunlp to to find what ports are being used.

Let me know if that’s helpful.

I was already suspecting that this must be the case… Now how can I finish the deployment of MemSQL? The port of MemSQL must be changed for the deployment as I don’t have the possibility to run MySQL on a different port as it is connected to multiple different systems.

Any news? Would really like to test MemSQL…

The easiest way to get memSQL running is likely to sign up for a Helios cluster:

Further, if that is not an option, consider using the standard memsql-tools deployment guide:

This will let you deploy each node on a given host (and you can deploy a master aggregator + single leaf as the smallest cluster) and specify ports you want to be used.

In particular, during one of the steps in the guide you use the memsql-admin create-node command. This command lets you specify a port:

memsql-admin create-node --host $HOST --password $PASSWORD --port $PORT

More documentation about that particular command is available here:

Well, then can you please provide a full guide on how to deploy it the same way cluster-in-a-box deploys it? I simply need to change the port, to give it a first test if it could be something for us… I am completely new to this and all the links you posted me above don’t really help right now.

Unfortunately the simpler cluster-in-a-box install does not support custom ports. As Hristo mentioned, you can follow the “Comprehensive” installation guide (SingleStoreDB Cloud · SingleStore Documentation) and use the --port option when you get to the memsql-admin create-node step. This installation guide works for both single host and multiple hosts.

Suppose you want to run MemSQL locally on ports 3310 and 3311. Then you can follow the following steps to launch the cluster in that setup:

memsql-toolbox-config register-host --localhost --host 127.0.0.1

memsql-deploy install --all

The above two steps will install memsql on localhost.

Then create 2 nodes while providing

memsql-admin create-node --host 127.0.0.1 --password <secure_password> --port 3310

memsql-admin create-node --host 127.0.0.1 --password <secure_password> --port 3311

You can see the nodes that were created:

memsql-admin list-nodes

One node will be on port 3310. Select it’s memsql id (you will see the ID in the output of the previous command.

Then run:

memsql-admin bootstrap-aggregator --memsql-id <MemSQL_ID of 3310> --license [YOUR LICENSE KEY]

This will create a master aggregator out of that memsql node.

The other node will be on port 3311. Run:

memsql-admin add-leaf --memsql-id <MemSQL_ID of 3311> --password <secure_password>

This will turn the second node into a leaf.

This combination of master aggregator + leaf is a MemSQL cluster.

You can connect to the master aggregator on localhost:3310 with username root and the password you specified.

Let me know what happens when you try to run these steps.

It seems memsqld is now running on port 3310, I was able to run all commands you specified without any errors.

Shouldnt there be a GUI that I can connect to as well?

EDIT: This is what I mean: SingleStoreDB Cloud · SingleStore Documentation

That’s the next step of the guide:

There are 2 commands in the article that will launch MemSQL Studio and start using it.

Edit: What’s the issue you have when you try to follow the steps there?

No problems, it works, the GUI is now running.

How can I now create a database and use the mysql-driver to connect to the memsql database?

Also: It says “2 units allocated of 4 available”, this means I could add another 2 leafs, correct? Does adding more leafs bring more performance when it comes to the databases overall speed for all operations?

And: I understand it is a “memory database”, but through some magic it will also persist the database. Can I be sure the data will always be safe if using it as a backbone for wordpress websites?

Hi Marius,

This is Elliot. I’ll email you a response to your questions.

Best,
Elliot

1 Like