Cannot Access LocalHost Using PostgresSQL on Presto - presto

I have Presto installed on my Mac. I also have PostgreSQL. Both are installed locally. I only intend to use them locally. Presto is working fine.
I followed the documentation listed here:
https://prestodb.github.io/docs/current/connector/postgresql.html
connector.name=postgresql
connection-url=jdbc:postgresql://example.net:5432/database
connection-user=root
connection-password=secret
Is there any command I can use in PostgreSQL to get the correct "connection-url". I have been trying the following, but it does not connect:
connection-url=jdbc:postgresql://localhost:8080:5432/MyDataBase
As well, is there a driver I should be downloading? I have been trying for weeks, but cannot get a connection running.

Not sure if this was the only issue you had, but in your connection URL you're specifying two ports i.e. 8080 as well as 5432.
Postgres generally runs on 5432 by default so I think you'd just need:
connection-url=jdbc:postgresql://localhost:5432/MyDataBase

Related

Node Can't connect to vagrant box

I am not sure if this is the correct place to ask my question, but really I am out of ideas, and my clock is ticking.
In short, I got a new machine that I need to make development ready.
This project is based on rather old program versions, that is a task to update.
In short I have set up the Vagrant (1.8.1) in VirtualBox (5.0.14). Chef (0.10.0) created all dependencies successfully and I can SSH to machine and see all is fine, all services are running as set in VagrantFile.
Vagrant box is latest ubunty/trystu64. My host machine is MacOs HighSierra(10.13.3).
Now, I open for example an mySQL editor (mySQL Workbench) and it connects to the Box, I can see DB and manipulate it.
My problem is with the NodeJS (I think). When I run my tests, it simply refuses to connect to the Box. More precisely, it attempts to connect to 127.0.0.1: 3306 (mySQL) and it errors. While MySQL Workbench performs the same connection without problems.
It seems the port forwarding in Vegrant works fine, as mySQL workbench is being forwarded to a box. Nodejs is not being forwarded, or something.
Is it Node doing it? Something else that I need to allow?
I have tried many different things, I have lost count. And always the same issue.
Is there something that I can do to Node, so it behaves as mySQL Workbench? Any idea is appreciated.
This identical setup used to work before, but not now.

Issue connecting to rabbitmq from container

I am having an issue connecting to a rabbitmq server. I can connect to it from the host machine but I cannot get a connection from the container. It used to work before I've upgraded my Ubuntu to 16.04.
Please help.
Got the answer finally. it's a new feature since the version 3.3.0 , It's preventing access using the default guest/guest credentials except via localhost as mentioned here.

How to Resolve Error Message: "No connection could be made because the target machine actively refused it."

I accidentally shorted out the power to my PC while programming Cassandra via cqlsh within Windows Command Prompt. After restoring power, I tried to re-run Cassandra via cqlsh:
C:\Program Files\....\apache-cassandra\bin>cqlsh
and received the following error message;
Connection error: (Unable to connect to any server’ {‘127.0.0.1’: error (10061,
“Tried connecting to [(‘127.0.0.1’, 9042)]. Last error: No connection
could be made because the target machine actively refused it”)}).
I’m using Cassandra version 3.0 on a single PC with a window 7 operating system and am using cqlsh via Command Prompt. This PC does not have any connections to any external clusters.
From similar questions relating to the same error message, there was the comment ‘”Actively refused it” means that the host sent a reset instead of an ack when you tried to connect. ….Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that port. This may be because it is not running at all or because it is listening on a different port. Once you start the process hosting your service, try netstat –anb to verify that it is running and listening on the expected port.”
Based on the above, I have looked at Windows Firewall Inbound and Outbound rules and cannot find any Local Port 9042. Unfortuntely, I don’t know the pathway in order to run netstat –anb.
Could someone provide steps to follow to re-establish the connection to port 9042, if this will fix the problem, or how to re-establish access to run cqlsh in Command Prompt again.
It's likely that the cassandra daemon/service is not running - I'm not familiar with Cassandra on windows (whether it runs as a service, or if you have to start it via command line), but however you started it previously, you should start it again in the same manner. On Linux, that would be /etc/init.d/cassandra start or ./bin/cassandra - on Windows, you'll either want to start the service, or ./bin/cassandra.bat or ./bin/cassandra.ps1 or similar.
For my case, I hadn't started the Cassandra server but was trying to connect to it directly. Here are the steps for what I did on Windows:
Start the Cassandra server via cmd
\bin> cassandra
Try to connect to its node
\bin> cqlsh
I think your answer no this
https://phoenixnap.com/kb/install-cassandra-on-windows
these are a steps for , from installation to start Cassandra server Everything is explained step by steps. I hope its helpful for you.

Remote access elasticsearch 9200 fails

I have a problem that i am facing but i didn't found solution in the forum and into elasticsearch official documentation. I have successfully installed elasticsearch 1.7.3 in OVH cloud machin and being able to connect via localhost through the curl localhost:9200. But i tried to connect remotely using http://158.69.78.66:9200/ (where 158.69.78.66 is the server address) without success. Please which configuration am i going to more in order to be able to remotely access elasticSearch in my server.
The attached file represent my elasticsearch.yml actual configuration.
Thanks,

PostgreSQL via pgAdmin III - Server Doesn't Listen

Our company has an old linux server that runs a few tomcat web applications. One of those applications is connecting to PostgreSQL. While I'm a C#.Net/Windows coder, I need to connect to this database from my computer using pGAdmin III (or any suggested equivalent). When attempting the connection, pgAdmin says Server Not Listening.
Without knowing much about linux I'm using WinSCP to connect to the file structure. I have ZERO documentation on the old apps, any data sources, or their data connections. I've been able to determine the following, assuming the location of the web app is actuallly legit and not some non-running copy.
PostgreSQL
In one app's connection information:
jdbc:postgresql://localhost:5432/somename
After some digging, I found the following possible instances of postgresql on the server file structure.
\etc\postgresql\8.3\main
\etc\postgresql\8.4\main
There's also \etc\postgresql-common with very different types of files in there.
If there are other instances or related folder, I am unaware and wouldn't know where to look. It's a labyrinthine beast.
I ensured in the config file for both that listening="*", which was supposed to be one of two fixes. It was already set to *, so assuming one of these is the right one, I should be good there.
I know that at least some instance of postgresql is turned on because the old app is running and fetching data, so that's the other of the two fixes.
pgAdmin
I heard in a separate thread here that reinstalling pgAdmin might solve the problem, but it did not. I tried with and without ssl.
Here is how I'm trying to set up the connection in pgAdmin III:
Name: SomeName
Host: I've tried a few combinations here. //servername/somename, or just //servername
Port: 5432 (matches what was expected, also the port from the connection)
Service: Blank
MaintenanceDB: I tried the default in pgadmin, postgres and the actual db I'm trying to connect to.
username & Password: the credentials from the connection info in the old app.
I'm getting the Server Doesn't Listen, suggesting that either it's not on (Well...some data source is on and working and the data in WEB-INF suggests it's postgresql), or it's not accepting TCP/IP connections, which it is according to the instances of postgresql I was able to find.
Long Story Short
At this point I'm assuming that one of the following is the problem...
The connection information I'm entering into postgreSQL is not being entered correctly, but I don't know what I'm doing wrong.
The source of the connection information (the web application) is bad/old/not from a running instance (and in this case I don't know how to tell, not in linux).
The instances of postgresql I found are not the instances it's using, and I have no idea how to find it.
Something's fishy network-wise, but since both my computer and the linux server are on the same network, it doesn't seem too likely.
Also, everyone, please document your stuff for the poor souls of the future. I greatly appreciate any assistance you are able to offer me.
You may want to use a tunnel:
ssh -L 5432:localhost:5432 user#server
After you log into the remote server, you'll have mapped port 5432 on your computer to the remote one. Then you can use pgAdmin to connect to your localhost on port 5432. Make sure you don't have anything running on this port on your computer.
Edit: Look at these examples on how to setup tunnels using putty

Resources