I installed neo4j enterprise edition load balancer with helm chart. but when i try to connect using LB ingress url i get the below error.
$ cypher-shell -a neo4j://a0b41a459c98447b8affdd85bbbd7c0a-1305064690.us-east-1.elb.amazonaws.com -u neo4j -p secret
Connection to the database terminated. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.
Related
I have Ubuntu in a Window (which I installed from Microsoft Store). In this Ubuntu, I have a Ruby web app in this Ubuntu which connects to Postgres in my Window (not Ubuntu). This is my database.yml (/apps/appname/config/)
development:
adapter: postgresql
encoding: unicode
pool: 5
host: localhost
port: 5432
database: xxx
username: postgres
password:
All these I have setup accordingly. When I run rails server, the web app starts and listening to localhost:3000. When I open the browser at localhost:3000, I get this error below:
> PG::ConnectionBad at /sign_in could not connect to server: Connection
> refused Is the server running on host "localhost" (127.0.0.1) and
> accepting TCP/IP connections on port 5432?
I have troubleshoot by running psql and I can connect to the database at port 5432.
Server [localhost]:
Database [postgres]: xxx
Port [5432]:
Username [postgres]:
Password for user postgres:
psql (10.15)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
How do I troubleshoot this further? I realize that I didn't run Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux in Windows PowerShell in Window before I install Ubuntu. Could the issue due to this step which I miss out?
First, I'm assuming this is a WSL2 instance, not WSL1.
WSL2 instances really do run in a VM. The "VirtualMachinePlatform" component is a subset of Hyper-V. The WSL2 instances are running NAT'd (not bridged) behind their own virtual NIC vEthernet (WSL).
localhost to the WSL2 instance points to the virtual interface, not to the Windows host. On the flip side, Windows does attempt to detect ports bound inside a WSL2 instance and allow Windows applications (such as a web-browser) access to the services on those ports via localhost. However, this seems to break down for some people every so often, requiring a wsl --shutdown of the VM in order to restore the functionality.
So yes, you can access the Rails app (running in WSL) using your web browser (running in Windows) at localhost. However, you can't access the Postgres server running in Windows from the Rails server running in WSL2 via localhost.
Or at least you shouldn't. I'm surprised that the psql command seems to be working. Is it that:
psql is running under WSL? (shouldn't work via localhost)
Or perhaps you mean that you are running psql from PowerShell or cmd? That would of course work via localhost
Or perhaps the psql command is in the Windows path that gets propagated to WSL? That would also allow it to work via localhost.
But ultimately, what you should need for accessing the Windows Postgres server from within WSL is to simply use a Windows IP or address pointing to it. I've detailed some options in this answer a few days ago. But short answer:
Use mDNS, the ".local" domain. If your hostname is stevesdesktop, then try replacing localhost in your database.yml with stevesdesktop.local.
If that doesn't work, use the Windows IP directly.
Or edit /etc/hosts with the IP and a name to assign.
When you say Ubuntu in a Window I suppose you have a Ubuntu running on a VM on your Windows OS.
From the Ubuntu system point of view, localhost is it's own IP, not the one where PostgreSQL is running.
The virtualization engine usually assigns an IP to the VMs running on it, depending on the configuration of the engine, the network configuration of the VM in it and the network configuration of the system inside the VM (usually, plain DHCP). I'd consider looking at all of them.
If you are creating an internal network (which is the default on some virtualization engines and usually is in the range 192.168.122.0/24), the IP of your host (the system running in the hardware, the one running the virtualization engine, the one running the PostgreSQL server, not the VM) inside this private network will probably be 192.168.122.1. That will be the IP where the VM will be able to connect to the PostgreSQL server.
Note: You'll need to ensure PostgreSQL is started after the virtualization engine starts the virtual network, so PostgreSQL will open the port on this network, too (well, I don't know very much about how Windows handles opening TCP ports, but it's a good practice).
Edit
While the above commands and tips are still useful, Ubuntu in a Window runs WSL, which is not a VM engine. As stated in the WSL FAQs:
WSL shares the IP address of Windows, as it is running on Windows. As such you can access any ports on localhost e.g. if you had web content on port 1234 you could https://localhost:1234 into your Windows browser.
the network stack is shared, so localhost and 127.0.0.1 are good hosts to connect applications across Windows and Linux apps. Also, as stated in the FAQs, your firewall might be blocking network connections. If disabling the firewall solves the problem, you'll need to explicitly allow the desired connection.
I am trying to add an existing MySQL database as a source database to a docker container running Apache Superset. The MySQL database that I am trying to add is not running in a docker container. It's an existing MySQL database running on a Windows machine.
I've added mysqlclient==1.4.6 to requirements.txt. The error message seems to indicate that the driver is installed.
I've used mysql://user:password#127.0.0.1:3306/database_name and mysql://user:password#localhost:3306/database_name
The error I get is:
"ERROR: Connection failed, please check your connection settings."
I am using image: apache / 'incubator-superset' v. 0.36.0
Are there any settings or config that needs to be changed to be able to communicate to an external database from within a running docker container?
So I figured it out. For Windows, run ipconfig (maybe ifconfig linux, mac) in terminal/powershell and check what ip address docker ethernet port is using (listed as WSL), let's say ip is: 172.x(x).x(x).x(x). Then configure connection string with ip address on docker ethernet port as follows: 'mysql://user:password#172.x(x).x(x).x(x):3306/database_name'.
Follow-up question if anybody knows: How can I connect my docker container running apache/superset to another server/ip address on my local network running a MySQL server? In other words I want to connect the apache/superset app that is running on my computer in a docker container, to another computer on my local network that is running a MySQL server. The MySQL sever is not in a docker container.
maybe the steps of this blog can help.
If your mysql is in other docker it it is not 127.0.0.1 and in addition if you don't want the requirements to be updated every time that you git pull a new docker, it is better to use the requirements-local.txt
You should be able to do that but your MySQL has to have external IP that you can access from your Supserset Machine. First do a telnet to see if you can listen from port 3306 to that machine and if you can Supserset should work with very similar URI that you have.
The mysql server is running on top of docker with Ubuntu OS.
I only want to allow the DB connections from the Ubuntu host machine and disallow all connecitons from the rest of world for the security reason.
Attempting to set up an ssh tunnel from my neo4j 3.2.3 graph database from my AWS EC2 instance to my local machine. Tried setting it up like I do for tunneling jupyter notebooks, but it looks like neo4j is blocking authentication or something.
So far I've attempted to change my neo4j.conf file on my (remote) EC2 instance according to online research:
# Whether requests to Neo4j are authenticated.
# To disable authentication, uncomment this line
dbms.security.auth_enabled=false
# With default configuration Neo4j only accepts local connections.
# To accept non-local connections, uncomment this line:
dbms.connectors.default_listen_address=0.0.0.0
# HTTPS Connector. There can be zero or one HTTPS connectors.
dbms.connector.https.enabled=true
dbms.connector.https.listen_address=0.0.0.0:7473
#dbms.connector.https.address=0.0.0.0:7473
And on my local machine I setup an ssh tunnel like I would for a jupyter notebook tunnel (which I have successfully setup already for this same EC2 instance):
ssh -NfL localhost:7474:localhost:7474 project <-- 7474 being the port neo4j is running on at my remote machine's local port
When I try opening the browser on my local machine at localhost:7474, I'm getting the welcome screen of the Neo4j browser, but it's not letting my sign in to the db. Instead, I get a "WebSocket connection failure".
It's autofilling the Host: to use bolt://localhost:7687 which I'm unfamiliar with. Entering username and password as well (which have been entered correctly).
Anyone know how to successfully ssh tunnel a neo4j (version 3.2.3) database to a local machine?
In you config it is using port 7473 but in your tunnel you're using 7474. It couldn't be this simple, could it? :)
Neo4J basically operates a ton of different ports: the 7474 is your web port for the HTTP, but it also runs "bolt" on a different port: usually 7687. This is also a TCP port, so you need to ssh tunnel that as well.
ssh -NfL localhost:7474:localhost:7474 -L localhost:7687:localhost:7687 project
should fix it for you. You may have to configure the port for bolt in your neo4j config
I'm using Kitematic to start my Docker containers. I'm trying to start the latest Neo4j container (3.2) and I cannot access the DB via the web browser because it requires authentication.
I tried to disable it via the environment variables (NEO4J_AUTH none) but that doesn't solve the problem.The standard passw/user neo4j/neo4j doesn't work
Any ideas how to set the authentication via Kitematic?
I have the same problem here but I can tell you why this is happening:
As you are using windows, you need to access Neo4J browser tool via the Docker Machine, that port forwards your request to the neo4j container. The forwarded request is basically an authentication request.
The problem is CHROME does not allow unsecured transfer of credentials and the forwarded request fall into that category. This is an issue that comes from chrome and not the Neo4J server. I'm still trying to find an elegant way of solving this for my students that uses windows.
The easiest way would be to connect to the neo4j container directly (which can be done in linux and mac).
Ok finally one of my student made it work.
make sure to publish both port 7687 and 7474 from your docker.
This way, both request will target localhost and the browser will stop complaining
here is a docker command showing how to publish both ports
docker run --rm --name neo4j_server -p 7474:7474 -p 7687:7687 -d neo4j