流浪端口转发不起作用 [英] Vagrant Port Forwarding not working

查看:178
本文介绍了流浪端口转发不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在运行CentOS 6.2vagrant 0.9.0框上安装了CouchDB.

I've installed CouchDB on my vagrant 0.9.0 box that is running CentOS 6.2.

Vagrantfile 中,我添加了config.vm.forward_port 5984, 5985.

重新加载无业游民后,我尝试卷曲地址:curl -v localhost:5985,结果不佳.

After reloading vagrant i attempt to curl the address: curl -v localhost:5985 with poor results.

* About to connect() to localhost port 5985 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 5985 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: localhost:5985
> Accept: */*
> 
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
* Closing connection #0

我感觉到端口转发工作不正常-最初我认为它可能与iptables有关,所以我禁用了它,但是,结果并没有改善.

I get the feeling that port forwarding isn't working properly - at first I thought it might have something to do with iptables so I disabled that but, alas, results did not improve.

几天来我一直对此表示怀疑.非常感谢您的协助.

Been beating my head against this for days now. Would greatly appreciate some assistance.

推荐答案

您的CouchDB很可能正在侦听虚拟机(而非物理机)的地址127.0.0.1.这是CouchDB的默认设置. local.ini中是否包含以下内容?

It's quite likely that your CouchDB is listening on address 127.0.0.1 of the virtual machine (not of the physical machine). This is the default for CouchDB. Do you have the following in local.ini?

[httpd]
bind_address = 0.0.0.0

重新启动CouchDB之后,使用netstat在虚拟机上 进行检查,如果更改生效:

After restarting CouchDB check with netstat, on the virtual machine, if the change took effect:

sudo netstat -tlnp |grep :5984

然后从虚拟机检查CouchDB是否运行正常:

curl http://127.0.0.1:5984/

如果看不到{"couchdb":"Welcome","version":"1.1.1"},请检查日志中是否有错误消息.可能是某些权限问题.

If you don't see {"couchdb":"Welcome","version":"1.1.1"}, check the logs for error messages. It may be some permissions problem.

您如何安装CouchDB?

How have you installed CouchDB?

这篇关于流浪端口转发不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆