When I try to do ./stack.sh after the call trace I am provide with the following error :
`[Call Trace]
./stack.sh:217:source
/home/work/devstack/stackrc:821:die
[ERROR] /home/suramya/devstack/stackrc:821 Could not determine host ip address. See local.conf for suggestions on setting HOST_IP.
`
After cloning:
cd devstack/
cp samples/local.conf .
Edit the local.conf by adding the setting the HOST_IP of your machine on which devstack is being installed.
Add HOST_IP=<your machine ip address> to local.conf file.
STEPS:
List item Go to the root folder where you cloned or copied "devstack". Like /opt/stack/devstack
Edit the "local.conf file. vi local.conf
Add HOST_IP=0.0.0.0 (replace 0.0.0.0 with your machine IP address) to the file. Save and exit. The complete file will look like this:
[[local|localrc]]
HOST_IP=13.84.214.151
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
Run ./stack.sh
This should run without errors.
First, get the IP address using the command:
ip addr show
Second, after you could get the IP address, copy and paste it in the local.conf file that you have created under the devstack directory, that should be looking like this:
[[local|localrc]]
HOST_IP=0.0.0.0 #replace 0.0.0.0 with your ip
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
then run ./stack.sh again.
Edit this file "/opt/stack/devstack/stackrc"
In this file, find the HOST_IP Variable and change it to HOST_IP=0.0.0.0
Instead of 0.0.0.0, set your IP Address (ifconfig)
First check the IP address of your server interface by using command ifconfig.
Then find the line
HOST_IP=$(get_default_host_ip "$FIXED_RANGE" "$FLOATING_RANGE" "$HOST_IP_IFACE" "$HOST_IP" "inet") in the file /opt/stack/devstack/stackrc.
Put your server IP (in my setup line number is 859), make sure the entry is like below:
if [ "$HOST_IP" == "192.168.0.0" ];
then save the file (suppose my server IPis 192.168.0.0).
Run ./stack.sh
It works for me.
You don't have to set up the HOST_IP. It would be great if you can share your local.conf file for us to take a further look.
Take a look at this: https://docs.openstack.org/devstack/latest/
And there is a sample local.conf file under /samples
Find the IP Address
Add HOST_IP=[IP_ADDRESS]
Make sure there is no space between the '=' and IP address in step 2.
What I did is to modify stackrc and set
HOST_IP=${HOST_IP:-192.168.227.1}
192.168.227.1 is my IP, use your IP instead.
On Ubuntu 22.04, following the devstack tutorial here: https://docs.openstack.org/devstack/latest/
one only has this in local.conf :
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
In the VM I run ./stack.sh in, I determined the IP from a shell:
ubuntu#ubuntu-Standard-PC-Q35-ICH9-2009:~/develop/devstack$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 52:54:00:e5:00:fb brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp1s0
valid_lft 85917sec preferred_lft 85917sec
inet6 fec0::dd5:3efa:4caf:756b/64 scope site temporary dynamic
valid_lft 86043sec preferred_lft 14043sec
inet6 fec0::e0d0:2dd7:984b:e9a6/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86043sec preferred_lft 14043sec
inet6 fe80::824d:ebd2:b04b:73ff/64 scope link noprefixroute
valid_lft forever preferred_lft forever
The IP is 10.0.2.15.
I simply added that as the HOST_IP so local.conf looks like:
ubuntu#ubuntu-Standard-PC-Q35-ICH9-2009:~/develop/devstack$ cat local.conf
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
HOST_IP=10.0.2.15
Then run the command again and it passes the step.
Related
I am trying to host the most basic python flask server over the linux container on ChromeOS.
The flask server hosts no problem, i have more of a problem with accessing it.
The thing is that the linux container runs over, by my understanding a private network with the ip 100.115.x.x
Hosting the flask server over this ip is working but somewhat obviously, not accessible over other devices over the network but how do i give it a accessible ip so that the server is accessible by it.
The ip ad command gives following output
5: eth0#if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:88:24:7c brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 100.115.92.195/28 brd 100.115.92.207 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::216:3eff:fe88:247c/64 scope link
valid_lft forever preferred_lft forever
So the solution was quite simple and i was apparently just using the wrong questions for my research.
For those having the same problem and not knowing how to solve it, here is my solution:
In the developer section of the advanced settings you go to port forewarding and port foreward port 5000, which is the standard port for your flask app.
The you run the script under the ip of your linux container and can access it over the ip of your chromebook
So in the shell you would get displayed that the server runs on
http://100.115.92.195:5000
but you would use
http://192.168.60.70:5000
for example. Use whatever is displayed to be the ip of the chromebook.
I create a go script who switch between IP linked to my eno1 interface.
In case my program perform a curl --interface "51.15.xx.xx" ... and switch between my 3 IPs
Bellow my interface :
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ac:1f:6b:27:xx:xx brd ff:ff:ff:ff:ff:ff
inet 51.15.xx.xx/24 brd 51.15.21.255 scope global eno1
valid_lft forever preferred_lft forever
inet 212.83.xx.x1/24 brd 212.83.154.255 scope global eno1
valid_lft forever preferred_lft forever
inet 212.83.xx.x2/24 brd 212.83.154.255 scope global secondary eno1
valid_lft forever preferred_lft forever
My program run perfectly when he run on host directly, he work too on
docker run --network=host.
But in production with a docker swarm (deployed on 1 node), i can't bind host network and my program can't run. I get the error: bind failed with errno 99: Address not available
I just want to bind host network with local scope on a swarm service or allow my swarm service to bind host ip
PS: I already try to bind network host but when I execute docker stack deploy, docker select a host network with scope swarm.
Best regards
Did you publish a port when declaring your swarm service or stack ?
According to the documentation:
If your container or service publishes no ports, host networking has no effect.
See https://docs.docker.com/network/host/
Try to use a direct command to create service, for example:
Code
docker service create --network host caa06d9c/echo
Docker image does not expose any ports
Check
curl localhost:8080
Output
{
"method": "GET",
"path": "/",
"ip": "127.0.0.1"
}
So port attached to the host and can be accessed from any interfaces.
By default we have a bridge named docker0 on host machine as one component of docker networking.
When we run a docker container, it creates a vethxxx pipe which binds docker0 with one point and container with the other point, named eth0.
I'm trying to find the trace of those eth0 interface on host machine.
I've expected to find some network namespace via:
ip netns show
But it's clear. So how could I see the representation of a container's eth0 interface on host machine?
Generally, each container has an isolated network namespace on host. And the interface eth0 in a container is encapsulated in a network namespace(aka sandbox in Docker terminology). So if you want to see eth0 on host side, you must enter its network namespace first.
But docker containers' network namespaces lay in different directory from those created manually. They lay in /var/run/docker/netns. So we need create a soft link to /var/run/netns.
ln -s /var/run/docker/netns /var/run/netns
ip netns list
ip netns exec xxxx ip addr show
Thus, you could see the other side of veth on host machine in each isolated network namespace.
root#Light-G:/var/lib# ip netns exec 459c238c2a4f ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
15: eth0#if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:0a:0a:c7:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.10.199.2/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::42:aff:fe0a:c702/64 scope link
valid_lft forever preferred_lft forever
Use kubeadm to install Kubernetes cluster by Vagrant followed official guide:
https://kubernetes.io/docs/getting-started-guides/kubeadm/
It was successful when install on master host:
kubeadm init
And generated a token:
[root#localhost ~]# kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION
1eb2c2.8c9s81b32cc9937e <forever> <never> authentication,signing The default bootstrap token generated by 'kubeadm init'.
Use this token to join from nodes hosts:
kubeadm join --token=1eb2c2.8c9s81b32cc9937e 192.168.33.200:6443
Then got error:
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Running pre-flight checks
[discovery] Trying to connect to API Server "192.168.33.200:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://192.168.33.200:6443"
[discovery] Failed to request cluster info, will try again: [User "system:anonymous" cannot get configmaps in the namespace "kube-public". (get configmaps cluster-info)]
[discovery] Failed to request cluster info, will try again: [User "system:anonymous" cannot get configmaps in the namespace "kube-public". (get configmaps cluster-info)]
[discovery] Failed to request cluster info, will try again: [User "system:anonymous" cannot get configmaps in the namespace "kube-public". (get configmaps cluster-info)]
The Vagrantfile:
# Master Server
config.vm.define "master", primary: true do |master|
master.vm.network :private_network, ip: "192.168.33.200"
master.vm.network :forwarded_port, guest: 22, host: 1234, id: 'ssh'
end
# Node1 Server
config.vm.define "node1", autostart: true do |node1|
node1.vm.network :private_network, ip: "192.168.33.201"
node1.vm.network :forwarded_port, guest: 22, host: 1235, id: 'ssh'
end
And, the ip address in master host:
[root#localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:98:15:79 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86132sec preferred_lft 86132sec
inet6 fe80::f7f:ed69:e0f3:2e88/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:6c:30:78 brd ff:ff:ff:ff:ff:ff
inet 192.168.33.200/24 brd 192.168.33.255 scope global enp0s8
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe6c:3078/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 02:42:0f:90:a5:21 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
I set the 192.168.33.200 as a private ip. Why it shows at the third position?
Is it the reason that node1 host can't access this host?
But I have did a test about apache server. After I installed httpd on master host, I can access the web page from browser: http://192.168.33.200.
Addition
I can ssh to master host(192.168.33.200) from node host(192.168.33.201). But need password:
[root#localhost ~]# ssh vagrant#192.168.33.200
The authenticity of host '192.168.33.200 (192.168.33.200)' can't be established.
ECDSA key fingerprint is 04:9d:3e:eb:4e:7b:14:17:2d:e8:18:0d:80:ab:71:9c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.33.200' (ECDSA) to the list of known hosts.
vagrant#192.168.33.200's password:
Last login: Wed May 24 01:09:34 2017 from 10.0.2.2
[vagrant#localhost ~]$
ip route information(master host 192.168.33.200)
[root#localhost ~]# ip route
default via 10.0.2.2 dev enp0s3 proto static metric 100
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 100
169.254.0.0/16 dev enp0s8 scope link metric 1003
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.33.0/24 dev enp0s8 proto kernel scope link src 192.168.33.200
For host with multiple interfaces, it's possible to specify the one that master listens on with
kubeadm init --apiserver-advertise-address <ip_address>
I am using docker to run my web app on my local machine and I have created mocked web service using SoapUI on host machine.
The mocked service is accessible through localhost:8099 and IP 127.0.0.1:8099 (using telnet), I am however unable to access it from running docker container.
I have read some articles about discovering host IP address through
ip addr show docker0
with results:
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:e3:36:43:5b brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:e3ff:fe36:435b/64 scope link
valid_lft forever preferred_lft forever
When I tried to ping IP 172.17.0.1 from docker container I am getting responses just OK, but when trying to call the mocked web service from my web app I get responses No route to host.
I have also tried to modify iptables using iptables -A INPUT -i docker0 -j ACCEPT but with no success.
Is there any other setting that I am missing?
Any help is appreciated.
Thanks, shimon
If I have read your question right your local and host machines are not the same machine. In which case you won't be able to (unless you have set a tunnel up on localhost:8099) be able to access your mocker service on the host machine using localhost as it will resolve to your local ip (on your local machine).
What you need to do is make sure both machines can talk to each other and use the host machines IP instead of localhost.