Remote access to cassandra Azure windows Instance - java

I have installed Cassandra on Microsoft azure instance from http://www.planetcassandra.org/cassandra/ and trying to access remotely from java client.I have enabled endpoints for port no 9042 but could not access it remotely. After googling I have modified listen_address to local IP of azure instance ,rpc_address to public IP and broadcast_rpc_address to 255.255.255.255 in cassandra.yaml file but still I could not access the instance form my java client.

Please try to refer to the article Running Cassandra with Linux on Azure and Accessing it from Node.js to set your Cassandra using PowerShell. It's for Linux instance, but I think it's helpful for you. And the comment at the bottom of the article, a blog shows more details as reference.
Meanwhile, the simple way to install cassandra is create a Datastax Enterprise instance from Azure Marketplace, please see https://ms.portal.azure.com/?feature.relex=*%2CHubsExtension#blade/Microsoft_Azure_Marketplace/GalleryFeaturedMenuItemBlade/selectedMenuItemId/home/searchQuery/cassandra. Then, you don't need to consider for installing on Azure, please see the tutorial for getting started with Datastax Enterprise.
Hope it helps.

Related

Remote MongoDB successful only when MongoDB is open on local

I have a Ubuntu VM in an EC2 AWS instance, with MongoDB installed. I can successfully save information to this database on my local machine using a spring boot application. However, this remote connection can only be made when I have a connection to remote Mongodb open on my local machine. Otherwise, the connection is refused.
My end goal is to have a mobile application that can preform CURD operations to a remote MongoDB.
Any help regarding this issue is appreciated.
Thanks.
You shouldn't be trying to connect to a remote MongoDB from a mobile application because anyone will be able to tamper with the information you are storing in it.
Consider using a local database bundled along with your mobile application or connecting from your mobile application to your Spring boot app which can then talk to the MongoDB instance.
Please check some point.
1: Please check remote connection open in your Mongo instance
2: Ec2 Instance have public accessibility
3: Ec2 Instance mongo port enabled and remotely accessible.
Did you confirm that the bind_ip actually changed to 0.0.0.0/0, ::/0

Connection to Openshift Online 3 from JAVA code outside the cloud

Openshift 2 will not work from tomorrow. Online 3 version is available. I use starter type.For Openshift 2 I could write/read data to/from MySQL DB located on openshift from my application that located on my PC, I mean from the code outside of the cloud. But now, with version 3 I have no idea hot to do it.
How to it now?
Is it possible to connect my local MySQL WorkBench to MySQL DB on Openshift Online 3 as well?
Port forwarding is very common method to make secure connection to remote machines. Its like creating a secure connection from your machine to the host machine. Once connection is build, any tool like MYSQL workbench can connect via localhost:<localport> where would forward the connection to remote machine's port.
Please read more about this feature here.
The port forwarding can be setup via any shell client supporting the feature, e.g. in a putty configuration.
Openshift V3 also support port forwarding through its client tool oc
Step wise:
1) Download and install oc tool. Refer here.
2) Once install on your machine (windows/linux), you could use port forwarding feature to access it from local machine.
Please refer openshift document here to setup port forward.
Once port forward is setup, leave the console open on local and try connecting to localhost:<localport> and you should actually get connected to MYSQL on openshift.
Yes, you can do this with port-forwarding:
https://katacoda.com/graham.dumpleton/courses/intro-openshift/port-forwarding

Not able to connect localhost with system ip

I have deployed my java web application using apache tomcact in my system through Eclipse. I can access the same page with
https://localhost:8080/Home.jsp
as well
https://mysystemip:8080/Home.jsp
But the same page is not able to connect
https://mysystemip:8080/Home.jsp over the network through other systems. Previously it was working and now not. What issue causing this ?
Your Tomcat server is only bound to your local network interface. You need to bind it to all interfaces for it to be available.
There is already a solution (Can't access Tomcat using IP address):
Add address="0.0.0.0" to Connector string

Connecting android client with oracle server

I need to connect over the internet with the Android client to Oracle PL/SQL database. (With static ip or with the host name).
But already using java client over the year with oracle. And I don't want to go for another database for implementing (Because I already written most complex procedures.,)
And that java client server connection happening via LAN connections only (But the system has the static ip and not used for this. Because LAN communication works perfectly).
Please tell me the process what I have to take.
Note: I am using Oracle 10g (10.2.0.5.0) and Latest Version of java (1.8).
If Possible: Please Provide a link for ojdbc drivers(Don't know which driver version used for Android).
Thanks in advance.

H2 Database Auto Server mode : Accessing through web console remotely

I am fairly new to H2 Database. As a part of a PoC, I am using H2 database(version : 1.4.187) for mocking the MS SQL Server DB. I have one application, say app1 which generates the data and save into H2. Another application, app2, needs to read from the H2 database and process the data it reads. I am trying to use Auto Server mode so that even if one of the application is down, other one is able to read/write to/from the database.
After reading multiple examples, i found how to build the h2 url and shown as below:
jdbc:h2:~/datafactory;MODE=MSSQLServer;AUTO_SERVER=TRUE;
Enabled the tcp and remote access as Below:
org.h2.tools.Server.createTcpServer("-tcpAllowOthers","-webAllowOthers").start()
With this, I am able to write to the database. Now, I want to read the data using the h2-web-console application. I am able to do that from my local machine. However, I am not able to understand how I can connect to this database remotely from another machine.
My plant is to run these two apps in an ubuntu machine and I can monitor the data using the web console from my machine. Is it not possible with this approach?
How can I solve this ?
Or do I need to use server mode and explicitly start the h2 server? Any help would be appreciated.
By default, remote connections are disabled for H2 database for protection. To enable remote access to the TCP server, you need to start the TCP server using the option -tcpAllowOthers or the other flags -webAllowOthers, -pgAllowOthers
.
To start both the Web Console server (the H2 Console tool) and the TCP server with remote connections enabled, you will have to use something like below
java -jar /path/to/h2.jar -web -webAllowOthers -tcp -tcpAllowOthers -browser
More information can be found in the docs here and console settings can be configured from here
Not entirely sure but looking at the documentation and other questions answered previously regarding the same topic the url should be something like this:
jdbc:h2:tcp://<host>:<port>/~/datafactory;MODE=MSSQLServer;AUTO_SERVER=TRUE;
It seems that the host may not be localhost and the database may not be in memory
Is there a need for the H2 web console?
You can use a different SQL tool using the TCP server you have already started. I use SQuirreL SQL Client (http://squirrel-sql.sourceforge.net/) to connect to different databases.
If you need a web interface you could use Adminer (https://www.adminer.org/) which can connect to different database vendors, including MS SQL, which happens to be mode you're running H2. There is an Adminer Debian package that should work for Ubuntu.

Categories