I have setup node in Azure VM (OS Windows) successfully. Below are the commands
geth --rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --datadir testprivareDir --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid XXXX
In my code hosted in Azure websites
new Web3.providers.HttpProvider("http://publicIP:8545")); **-- not working**
new Web3.providers.HttpProvider("http://dnsname:8545")); **-- not working**
Note
I can access it in Remix web3Provider using localhost:8545 inside the VM with the node, but I can't access outside the VM using the public IP (publicIP:8545) or the DNSName:8545
I have port 30303, 8545, 22,8000, 8080 open in network security group of the VM
The node is currently mining successfully as well
rpccorsdomain "*", --rpcaddr 0.0.0.0, try also --rpcaddr StaticIP
I am thinking if I can access it in Remix outside the VM with node, it should probably work as well in Azure websites.
Will answer my own question so others can see it also.
In the Azure Network Security Group - make sure port 22 is the first priority (priority 100).
Before - set up is 8545 priority 100, 22 priority 101 - did not work
After - set up is 22 priority 100, 8545 priority 101 - it worked :)
I am not really sure at moment why this ordering affects it.
Related
Installed ElasticSearch on a linux VM in Azure, put in on a Vnet with a public IP and a security group with ports 9200 and ssh 22 open.
I can ssh into the VM. On the VM itself, I can reach port 9200.
But on my PC, when I try to hit the {public IP}:9200, I get a 502 bad gateway? Anyone know why?
Ok, needed to set the following line in the /etc/elasticsearch/elasticsearch.yml file;
BEFORE
#
#network.host: 192.168.0.1
#
AFTER
#
network.host: [_local_, _site_]
#
I would like to deploy a container based app in azure container service, and followed this tutorial.
https://learn.microsoft.com/en-us/azure/container-service/dcos-swarm/container-service-mesos-marathon-ui
Everything went well except that the public url is showing
ERR_CONNECTION_TIMED_OUT in browser.
When pinging the url, able to get the IP address but pings are showing as timed out.
I have verified agents LB with port 80 as allowed in the rules list.
How to access the application through public web ?
When pinging the url, able to get the IP address but pings are showing
as timed out.
Azure disable ICMP package, so you could not ping Azure public IP address. You could use telnet or tcping to check whether your service is listening.
Do you bind port 80 of the container to port 80 of the DC/OS agent? If I don't do this, I get same error log with you. Please refer to this link.
Note: I test in my lab, if I did not do this, nginx service will listen on other port. I ssh to the agent VM.
root#dcos-agent-public-65818314000001:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7e8091548413 nginx "nginx -g 'daemon off" 14 minutes ago Up 14 minutes 0.0.0.0:4912->80/tcp mesos-d7be0314-6be2-467b-8376-433a05033b17-S1.42edeac0-2aa3-4ecd-acaa-17d5f2f4ac19
The service is listening on port 4912 not 80.
If you do this step, I suggest you also could ssh to agent VM(same user name and private key) and execute docker ps .
I have created a docker container in Azure on Windows 2016.
Here is my DOCKERFILE:
FROM microsoft/aspnet
COPY ./ /inetpub/wwwroot
EXPOSE 443
EXPOSE 80
I run it up like so:
docker run -d --name myctr myimg -p 443:443
I can browse to it via the a domain name, which I configure in the hosts file. SUCCESS!
On a remote machine, outside of the Azure network, I configure my hosts file, using the IP address of the Azure VM (and have also tried using the IP address of the container - not sure which one to use!)
However, I can't browse to it from outside of Azure.
Windows Firewall
I have disabled the Windows firewall.
Azure NSG
I have set up a Network Security Group which allows traffic in on port 443 (I have another website running on this box, and can access it from outside of Azure, with success)
Netstat shows the following:
netstat -ano | findstr :443 | findstr ESTABLISHED
TCP 10.0.0.4:49682 99.99.99.99:443 ESTABLISHED 1252
TCP 10.0.0.4:49700 99.99.99.98:443 ESTABLISHED 2476
TCP 10.0.0.4:49718 99.99.99.92:443 ESTABLISHED 5112
How do I configure the container/host/Azure so that I can view the website hosted on the container from a remote machine outside of Azure?
Any ideas greatly appreciated!
How do I configure the container/host/Azure so that I can view the
website hosted on the container from a remote machine outside of
Azure?
By default,-p 80:80 means we are mapping port 80 of container to host port 80. So now others can access port 80 of your host to hit port 80 of container.
Here a example:
PS C:\Users\jason> docker run -d -p 80:80 microsoft/iis
3bf999503cd3110ae8fb1c01cc5c8c6153645a0d533960339490a0ba50634d3a
After add port 80 to NSG inbound rule, I can browse it via Internet:
I have set up a Network Security Group which allows traffic in on port
443 (I have another website running on this box, and can access it
from outside of Azure, with success)
In your scenario, your port 443 in use, we can't bind docker with port 443, please try another port.
1- I created a new containerservice in azure.
2 - The creation was done following the portal step by step.
3 - I have not changed any configuration of any service, VM, balancing, master and agent.
4 - I can connect with PuTTY normally.
5 - I can open a tunnel by redirecting port 80 to port 80.
Following this tutorial, I can put the container to run::
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ffe6a1c890e4 yeasy/simple-web "/bin/sh -c 'pytho..." 31 minutes ago Up 31 minutes 0.0.0.0:80->80/tcp vibrant_morse
If I access localhost from my browser I can reach port 80 of the container and see the identical "Real Visit Results" page of the tutorial.
But in the tutorial it says that if I use load balancer's DNS I should see the result, that's my problem, I can not access the container through DNS, I only get timeout.
Reinforcing, I created a container service and did not change any configuration, just entered with PuTTY and put the container to run.
According to your description, it seems that you don't set your DOCKER_HOST environment variable to the local port configured for the tunnel. When you ssh to your master VM, you need execute command below:
export DOCKER_HOST=:2375
Run the Docker commands that tunnel to the Docker Swarm cluster. For example:
docker info
If you don't set the environment variable on the tunnel, the docker contanier is created on master VM, so you could not get the Web with agent Public IP.
Also, you could not set environment variable, but you need to point to the host when you execute docker command. More information please refer to this link
My environment:
Master:
Azure VM running Ubuntu 14.10
Docker (1.9) running Jenkins Image
I have added port 8080 (for UI) and 50000 (for slave) as endpoints on the Azure VM.
Slave:
Windows 10 (running on Mac via BootCamp)
Configured the firewall to allow inbound and outbound traffic on port 50000 (that slave jnlp seems to be using).
I can access my Jenkins Master install over the web. I am trying to configure the slave on my Windows 10 m/c. I have tried all 3 methods to configure the slave.
Each time after several retries, the slave throws the "Connection Refused" error (screenshot attached).
Slave Error Screenshot
Can someone help point me in the right direction? I have little knowledge of Linux systems but proficient with Windows.
I have tried the workaround here but it hasn't worked for me.
There's three things that I think you can check here:
Check that you expose port 50000 on your Jenkins docker container. Check for the Dockerfile, there must be a clause EXPOSE 5000 or something. Or when you run your container run it with something like this: docker run -it -p 50000:50000 which maps local post 50000 to the containers port 50000.
Check that you don't have any security rules on Azure blocking port 50000 to your Azure VM. Don't know about Azure but in AWS you allow port 50000 in your security group(s).
Check your Azure VM's firewall. Is it Windows? Check the firewall and allow port 50000. Is it Linux ? Check iptables and allow port 50000.
Hope it helps.