Couldn't connect to the PD Server using `127.0.0.1` in TiDB - tidb

I have deployed a TiDB cluster for testing. When I was using PD Control, I found that I could only connect to the PD server using the local IP address, but couldn't connect to it using 127.0.0.1. I'm wondering why.

If your TiDB cluster is deployed using TiDB-Ansible, the PD external service port is not bound to 127.0.0.1, so PD Control won’t recognize 127.0.0.1.

Related

Gocql configuration issue when connecting to YugabyteDB in Kubernetes cluster

[Question posted by a user on YugabyteDB Community Slack]
I'm currently trying out the Yugabyte k8s operator deployment with my app, which is using the Go Yugabyte cql driver. I have the app working, connecting, and querying seemingly fine, using a single dns yb-tservers.my-namespace.svc.cluster.local that resolves to 3 ip addresses. My app is in a different k8s namespace on the same cluster. However, the app is logging the following from the client driver:
gocql: events: unable to fetch host info for (10.x.x.1:9042): host not found in peers table
gocql: events: unable to fetch host info for (10.x.x.2:9042): host not found in peers table
It seems to be doing that for 2 of the 3 ip addresses resolved from the dns. Are there any obvious go-to configuration issues to look at here?
Specify the tserver addresses with their headless service dns names like below and it should work:
yb-tserver-0.yb-tservers.my-namespace.svc.cluster.local
yb-tserver-1.yb-tservers.my-namespace.svc.cluster.local
yb-tserver-2.yb-tservers.my-namespace.svc.cluster.local

Can we connect to Cassandra using cluster name and not IP address?

My Cassandra cluster name is: "Test Cluster"
It has three nodes with three separate IPs.
I am able to connect using the IP and password.
I need to know if there is a possible way to connect using Cluster Name and not IP addresses.
You can't use only cluster name - driver need somehow to find at least one node to connect to cluster. You can use host name although, not IP, and then driver will discover the other nodes in the cluster after connection to any node of the cluster.
You can connect your node using your hostname or IP address from the CQLSH. Generally we connect locally without IP if your node resolves the hostname and you configured /etc/hosts
You cannot connect using Cluster name in Cassandra.

Accessing Spark in Azure HDInsights via JDBC

I'm able to connect to hive externally using the following URL for a HDInsight cluster in Azure.
jdbc:hive2://<host>:443/default;transportMode=http;ssl=true;httpPath=/
However, I'm not able to find such a string for spark. The documentation says the port is 10002, but its not open externally. How do I connect to the cluster to run SparkSQL queries through JDBC?
There is not one available. But you can vote for the feature at https://feedback.azure.com/forums/217335-hdinsight/suggestions/14794632-create-a-jdbc-driver-for-spark-on-hdinsight.
HDInsight is deployed with a gateway. This is the reason why HDInsight clusters out-of-box enable only HTTPS (Port 443) and SSH (Ports 22, 23) communication to the cluster. If you don' t deploy the cluster in a virtual network (vnet) there is no other way you can communicate with HDInsight clusters. So instead of Port 10002 Port 443 is used if you want to access the Spark thrift server. If you deploy the cluster in a vnet, you could also access the thrift server via the ip address it is running on (one of the headnodes) and standard port 10002. See also public and non-public ports in the documentation.

unable to access DB pod External IP from application

I've created two pods top of Azure Kubernetes cluster
1) Application
2) MS SQL server
both pods are exposed via Azure Loadbalancer and both having External IPs. I am unable to use the External IP in my application config file. But I can connect that SQL Server from anywhere. For some reason I am unable to telnet DB IP from Application container.
the connection is getting timeout. but I can ping/telnet the DB's cluster ip. So I have tried to use the DB cluster IP in my config file to check if the connection is successful but no luck.
Could someone help me with this ?
As Suresh said, we should not use public IP address to connect them.
We can refer to this article to create a application and a database, then connect a front end to a back end using a service.
This issue was fixed in other way. But still running a Application & DB as separate service is night mare in Azure container service(Kubernetes).
1) I've combined App+DB in same container and put the DB connection string as "localhost" or "localhost,1433" is my application config file.
2) Created Docker image with above setup
3) Created pod
4) Exposed pod with two listening ports "kubectl expose pods "xxx" --port=80,1433 --type=LoadBalancer
5) I can access the DB with 1433
In the above setup, we have planned to keep the container in auto scaled environment with persistent volume storage
Also we are planning to do the scheduled backup of container, So we do not want to loose the DB data.
Is anybody having other thoughts, what the major issue factors we need to consider in above setup ??
This issue was fixed..!
Create two pods for Application and DB, Earlier when I provide the DB cluster IP in application config file, it was worked.But I was able to telnet 1433
I have created another K8s cluster in Azure then tried with same setup (provided cluster IP). This time it worked like charm.
Thanks to #Suresh Vishnoi

Access Cassandra Node on the Azure Cloud from outside

I have created a Linux VM with a single node Cassandra cluster installed.
Cassandra.yaml has the following:
seeds:
listen address:
rpc address:
netstat -an check with all required port are up and listening. (i.e. 9160, 9042)
I am trying to connect my application which is outside of the Azure cloud to access the cassandra cluster in the cloud. Looks like the connection between the outside host to the Azure cloud Cassandra node has been block.
Wonder if there is a true restriction to access Azure VM from out of network. Is there a way to access this cassandra node from outside?
If someone can answer my question would be very nice.
Thank you!
You need to go to the "Endpoints" of your virtual machine:
At the bottom click on "Add", and add new endpoints for these ports.
Then you will need to manage ACL for each endpoint, defining the IP ranges of the allowed and blocked IP addresses.
Keep in mind that, if the internal IP that is used by the virtual machine, is different from external (public) IP, that is used by the client, then depending on a driver you may need to teach it how to do address translation. Otherwise, the cluster will report only internal IPs upon the discovery request, which will obviously be not accessible from outside.
From this and from the security prospective I would recommend setting up cassandra cluster inside of the virtual network, and accessing it via VPN.
There is a comprehensive tutorial how to do it here: http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-nodejs-running-cassandra/

Resources