User another TLD instead of .local
Let’s change *.openshift.local
to *.openshift.vm
or whatever:
- cnpaas-openshift/Vagrantfile
- cnpaas-openshift/bin/init/dev-bootstrap.sh
- cnpaas-openshift/bin/init/ext-domain-setup
- cnpaas-openshift/bin/init/set-env
- cnpaas-portal/config/autoload/app_config.env.yml
- cnpaas-portal/config/autoload/paas_cfg.env.yml
Some references articles explaining this stupid behaviour:
ACCESSING .LOCAL DOMAINS IS SLOW ON MAC OS X
This appears to be a fault in Mac OS X Lion, where it takes 5 seconds to resolve .local domain names, even if they are hardcoded in your /etc/hosts file. You can work around this problem by using Charles's DNS Spoofing tool intead of /etc/hosts, however you'll experience the .local DNS resolution delay when not using Charles. I recommend using an alternative TLD such as .dev.
Comments (13)
-
reporter -
reporter The hostname change didn't work because the following line was unstable for Vagrantfile:
config.vm.hostname = "broker.openshift.vm"
Looking for other methods.
-
reporter - changed status to resolved
fix: change .openshift.local to .openshift.vm (fixing issue
#99)→ <<cset 6ad77d41b81b>>
-
reporter Revert "fix: change .openshift.local to .openshift.vm (fixing issue
#99)"This reverts commit 6ad77d41b81b8bc44073d675635a6a1de79fa704.
→ <<cset 9afb24f6f5bb>>
-
reporter The line was unstable because I haven’t updated
/etc/hosts
properly. This solution should actually be fine. -
fix: change .openshift.local to .openshift.vm (fixing issue
#99)→ <<cset 3544acbcabcf>>
-
Merged in liahsheep/cnpaas-portal/openshift_vm_hostname (pull request #120)
fix: change .openshift.local to .openshift.vm (fixing issue
#99)→ <<cset 9d630b6dfb61>>
-
reporter Revert "fix: change .openshift.local to .openshift.vm (fixing issue
#99)"This reverts commit 3544acbcabcf598101fcb1f817394d86e505e513.
→ <<cset b8f8063895ca>>
-
- changed status to open
Will work on this after Apr 2nd.
Ideally, broker hostname is called
broker01.oo.cnpaas.localhost
. App domain will beapps.cnpaas.localhost
, so we have a more consistent prod/staging/prod naming. -
reporter But the problem is .localhost is used for 127.0.0.1 by default. I'm not sure if dnsmasq can set it properly?
-
I believe they are configurable both on
/etc/host
and dnsmasq.Set localhost to one IP, and abc.localhost to another IP.
-
reporter Found a workaround (finally). Short answer is to use the following in
/etc/hosts
:::1 broker.openshift.local apps.openshift.local ::1 app01-test01.apps.openshift.local 192.168.33.10 broker.openshift.local apps.openshift.local 192.168.33.10 app01-test01.apps.openshift.local
Long answer:
Mac OS looks up
.local
domains by the following order:- IPV6 entries in
/etc/hosts
- IPV6 Bonjour service
- IPV4 entries in
/etc/hosts
- IPV4 Bonjour service
The 5-second timeout occurs in Step 2, when Mac couldn’t find a machine matching the host name, then it proceeds to Step 3. If we add duplicate
::1
entries in/etc/hosts
, we can trick Mac to think it is a IPV6 address and proceed to Step 3 directly.Ref:
- http://stackoverflow.com/a/6992469/1316828 (answer by guns)
- IPV6 entries in
-
- changed status to resolved
- Log in to comment
You may have to update the
dnsmasq
settings to openshift.vm after this merge.