I setup the DataStax Cassandra Sandbox on Azure using their image. I was able to run OpsCenter locally on the server without any issues. The install is Ubuntu which I am very new to.
Per this post Apache Cassandra remote access, I should be able to set my rpc_address to 0.0.0.0 to allow remote access to my database. However it says unable to connect when attempting a connection from DevCenter on my local Windows 8 PC.
Here are my settings:
The contact host address is the virtual ip address shown in Azure for my VM. The port is the same one shown in the cassandra.yaml config file. I haven't configured any authorization and from what I have read I should just be able to connect using .NET or the management tools but neither works.
I also checked to see if the ports are open which they are as far as I can tell:
Far I know it would be either 9160 or 9042.
Thanks to everyone who helped me figured this out. Ultimately the issue was that when setting up an Azure VM, the Virtual IP that is assigned is for the cloud service itself and not the virtual machine. Therefore even though it appears that the proper ports are exposed you are not able to access them from an external computer.
More info about it here (but read my instructions below first since this is much easier to do in the Azure Management Console).
You will notice when setting up your virtual machine that Azure automatically creates an endpoint for your SSH connection such as 55xxx. You won't be able to connect to the configured port of 22 as shown on the box itself, but instead will have to use the endpoint port of 55xxx, etc.
This is important to note because the same goes for the Cassandra ports 8888 (OpsCenter), and 9042 (native transport).
So you can either:
I couldn't get the endpoints to work at first, but later got them working. This lead me to setup a public ip address. I did it the hard way using the Azure Powershell. This was painful and a lot of research. But, after spending the time to do this, I realized it can now be done in the preview console. Simply go to the IP Addresses settings on your VM and enable the "Instance IP Address" option.
Then you should be able to connect remotely to OpsCenter using the ip address that is returned after the setup is complete via your browser: (The New IP Address):8888
...then in DevCenter using the new ip address and port 9042.
If you used endpoints instead of setting up a public static ip (which you will want to do for security reasons and enable user access control via ip filters), then you will want to use those newly created port numbers instead along with your virtual ip address.
Secondly... you will need to set rpc_address to 0.0.0.0 in the cassandra.yaml file.
Far I know it would be either 9160 or 9042.
As you can see from your connection settings screenshot, DevCenter connects to Cassandra via the "Native Protocol." This refers to the Native Binary Protocol which (unless you altered native_transport_port
in your cassandra.yaml
) runs on port 9042. Thrift connects via port 9160, and I do not believe that you can configure DevCenter to connect with Thrift.
Next, check the values of listen_address
and broadcast_address
in your cassandra.yaml
. At least one of these should be defined with your hostname or external IP address.
Set your "Native Protocol port" to 9042. Then try to connect to your external IP address.
Edit:
Check your system.log
file and look for a line like this:
Starting listening for CQL clients on localhost/127.0.0.1:9042...
Whichever address you see there is the address that you need to connect to via DevCenter or a client. If that line shows 127.0.0.1, you have work to do.
Also, here are links to a similar question that I have helped out with in the past: How do I connect to local cassandra db
Did either of you have to assign a public IP to your vm?
Our (cloud based) Cassandra servers (in prod) have both internal and external IP addresses. I'll have to double-check tomorrow, but our Cassandra 2.0 configs had listen_address
set to our external (public) IP and rpc_address
either blank or set to the same.
Here are some docs that might help you get this configured:
cassandra.yaml
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With