I wanted to give a try to vault, so I configured VAULT_ADDR as:
$ echo $VAULT_ADDR
http://127.0.0.1:8200
then I started vault in dev mode (vault server -dev) and everything was ok, I was able to connect to the server.
Then I wrote a really simple config file:
$ cat vault.config
backend "inmem"
listener "tcp" {
address = "127.0.0.1:8200"
tls_disable = 1
}
disable_mlock = true
and I restarted the server with vault server -config=vault.config, but then when I connect to the server, I get:
$ vault status
Error checking seal status: Get http://127.0.0.1:8200/v1/sys/seal-status: dial tcp 127.0.0.1:8200: getsockopt: connection refused
Is there something wrong in my config file?
You need to configure the back end like this:
backend "inmem" {}
otherwise there is a problem parsing the listener clause.
Related
I am trying to connect to a mosquitto broker, across linux clients. I can get everything working from the local machine, but when trying to connect from another machine I get the error ConnectionRefusedError: [Error 111] Connection refused.
Here is the process:
On the local machine, I install mostquitto, stop the service and start a live instance:
#Terminal 1
sudo service mosquitto stop
mosquitto
I then try and pub and sub, from distinct terminals on that machine:
#Terminal 2
mosquitto_sub -t 'test'
#Terminal 1 shows new connection
#Terminal 3
mosquitto_pub -t 'test' -m 'Hello, world!'
#Terminal 1 shows new connection, and then disconnect.
#Terminal 2 shows 'Hello, world!'
I now try to connect from a remote machine. First I edit the mosquitto config file to allow unauthorized connections:
sudo nano /etc/mosquitto/mosquitto.conf
#Add the following:
listener 1883
allow_anonymous true
protocol mqtt
I note that the mosquitto logs previously showed only local connections allowed, after editing the config file and restarting, the logs no longer show that message.
Then I install paho-mqtt on another machine. I run the following python script:
import paho.mqtt.client as mqtt
client = mqtt.Client('131')
client.connect('192.168.0.146') #The IP of machine 1, running the broker where the code above ran correctly across the terminals
I get the error mentioned above:ConnectionRefusedError: [Error 111] Connection refused. The mosquitto instance on machine 1 shows nothing. Logs show nothing.
I can't work out what is going on. I have read every question on SO that I can find. Nothing goes beyond changing the config file. I have tried running the broker on two machines (laptop and pi). I have tried connecting from multiple different sources: esp32 board, different laptop and pi. Nothing works. I can only assume there is some network-wide problem, but my network isn't isolating devices as I ssh into my pi all the time and have wifi lights and switches running on the LAN.
If anyone can help me troubleshoot I would be very grateful.
Mosquitto will not pick up a default configuration file, you must always pass the configuration file with the -c command line argument or it will fall back to the baked in config (that will only listen on localhost)
The service includes -c /etc/mosquitto/mosquitto.conf to force it to use the config file.
experiencing connecting workbench through SSH tunnel to connect to a hosted mysql DB. I'm using port 3309 as I have a local wamp server running mysql on 33066
My first time trying to connect via SSH so any help would be appreciated...
If I try through workbench using standard TCP/IP over SSH I get the below error message
Failed to Connect to MySQL at dbxxx.db.1and1.com:3306 through SSH tunnel at user#homexxxxxxx.1and1-data.host:22 with user dboxxxxxx
[Content]
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
If I use an SSH connection via putty with port forwarding I get the following error
Putty port forward config: source = 3309 destination = dbxxx.db.1and1.com:3306
Error I get back when connecting through workbench is:
Failed to Connect to MySQL at 127.0.0.1:3309 with user dbuser
[Content]
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
I have harbor git registry in private network.
This network connect internet using router.
I try docker login where remote server. This server not in private network
(Remote server - Router - Harbor(Server) )
I receive error message
Error response from daemon: Get "https://harbor-host-name:{port}/v2/": Get "https://192.168.x.x:{port}/service/token?account={harbor-id}&client_id=docker&offline_token=true&service=harbor-registry": dial tcp 192.168.100.102:8088: connect: no route to host
What should i do this situation?
Another remote server in private network can login successfully.
Solved.
vim harbor.yml
external_url: https://harbor-host-name:{port}
Good Luck!!!
Is it possible to connect to SQL Server Express (localdb) from a container instance?
docker-compose sample connection string:
foo-api:
image: foo-api
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings:DefaultConnection=Server=host.docker.internal\\mssqllocaldb;Database=FooDB;MultipleActiveResultSets=true;User Id=foo;Password=Your_password123;
build:
context: ../ms-foo/src/
dockerfile: Dockerfile
ports:
- "6004:6004"
Running the app # localhost wtih this config works just fine:
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=FooDB;MultipleActiveResultSets=true;User Id=foo;Password=Your_password123;"
},
Is there some dns resolution I'm missing or does the instance need to be shared somehow?
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver15#shared-instances-of-localdb?
Update
Including the error message.
{
"error": "14 UNAVAILABLE: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)"}
You can reach the parent host on the container's network gateway.
Let's say your container address is 172.21.0.2. In that case, you can most likely find the SQL server at 172.21.0.1 (and the correspondent listening port).
To find out the container's IP, you can try to jump into it and print its network config, i.e. docker exec <container name> ip a, but often ip and ifconfig commands are not installed, so I'd suggest looking at the bottom of docker inspect <container name>. Keys IPAddress and Gateway hold the discussed values.
You can then build your container with a custom /etc/hosts, or point it to DNS server that can resolve this, so you can use nice names instead of IP addresses.
I think that your error related to the environment variable defined on your docker-compose file , the second variable must be like that:
variable_name="value2"
So for your case must be like that:
DB_CONNECTION_STRING="ConnectionStrings:DefaultConnection"
DB_SERVER="host.docker.internal\\mssqllocaldb"
DB_NAME="FooDB"
DB_MultipleActiveResultSets=true
DB_USER_ID="foo"
DB_PASSWORD="Your_password123"
after that you can use this env variables to define your connection:
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=FooDB;MultipleActiveResultSets=true;User Id=foo;Password=Your_password123;"
},
I hope that can help you to resolve your issue.
Hello i am having trouble with vagrant setup.
So i am trying to ping serverless API which runs on http://localhost:3000/ (and it's outside vagrant project).
Right now my vagrant project runs on https://localhost:4443/.
Overall trying to CURL request from vagrant project to another serverless project.
Tried to use http://localhost:3000/ in CURL request but getting Failed to connect to localhost port 3000: Connection refused
Tried to use VM ip 10.0.2.15 address same
Tried to do port forwarding in vagrantfile config.vm.network :forwarded_port, guest: 3000, host: 3000 and use machine IP address 192.168.0.16, getting empty response from server, when i try to do telnet 192.168.0.16 3000 getting
Trying 192.168.0.16...
Connected to 192.168.0.16.
Escape character is '^]'.
Connection closed by foreign host.
Any idea what to try?
I had to use VM IP address something like
curl -X GET http://10.0.2.2:3000
These errors may be caused due to follow reasons, ensure the following steps are followed. To connect the local host with the local virtual machine(host). Here, I'am connecting http://localhost:3001/ to the http://abc.test Steps to be followed:
1.We have to allow CORS, placing Access-Control-Allow-Origin: in header of request may not work. Install a google extension which enables a CORS request.*
2.Make sure the credentials you provide in the request are valid.
3.Make sure the vagrant has been provisioned. Try vagrant up --provision this make the localhost connect to db of the homestead.
Try changing the content type of the header. header:{ 'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8;application/json' }
this point is very important.