- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已在 AWS Linux 实例上安装了 CouchDB,并且可以通过 SSH 成功访问它,但无法使用实例公开可用的 URL 访问它。
在 SSH 中,我可以运行 curl -X GET http://127.0.0.1:5984/_all_dbs
它给我 ["_replicator","_users","baseball"]
这正是我所期待的。
如果我尝试在 Chrome 中使用我的 AWS 实例 URL:http://ec2-xx-xxx-xx-xx.eu-central-1.compute.amazonaws.com:5984/_utils
Chrome 表示网站拒绝连接。
我已编辑 CouchDB local.ini 文件以添加 CORS。 local.ini 现在看起来像这样:
; CouchDB Configuration Settings
; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.
[couchdb]
;max_document_size = 4294967296 ; bytes
[httpd]
enable_cors = true
bind_address = 0.0.0.0
[cors]
origins = *
;port = 5984
;bind_address = 127.0.0.1
; Options for the MochiWeb HTTP server.
;server_options = [{backlog, 128}, {acceptor_pool_size, 16}]
; For more socket options, consult Erlang's module 'inet' man page.
;socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
; Uncomment next line to trigger basic-auth popup on unauthorized requests.
;WWW-Authenticate = Basic realm="administrator"
; Uncomment next line to set the configuration modification whitelist. Only
; whitelisted values may be changed via the /_config URLs. To allow the admin
; to change this value over HTTP, remember to include {httpd,config_whitelist}
; itself. Excluding it from the list would require editing this file to update
; the whitelist.
;config_whitelist = [{httpd,config_whitelist}, {log,level}, {etc,etc}]
[query_servers]
;nodejs = /usr/local/bin/couchjs-node /path/to/couchdb/share/server/main.js
[httpd_global_handlers]
;_google = {couch_httpd_proxy, handle_proxy_req, <<"http://www.google.com">>}
[couch_httpd_auth]
; If you set this to true, you should also uncomment the WWW-Authenticate line
; above. If you don't configure a WWW-Authenticate header, CouchDB will send
; Basic realm="server" in order to prevent you getting logged out.
; require_valid_user = false
[log]
;level = debug
[log_level_by_module]
; In this section you can specify any of the four log levels 'none', 'info',
; 'error' or 'debug' on a per-module basis. See src/*/*.erl for various
; modules.
;couch_httpd = error
[os_daemons]
; For any commands listed here, CouchDB will attempt to ensure that
; the process remains alive. Daemons should monitor their environment
; to know when to exit. This can most easily be accomplished by exiting
; when stdin is closed.
;foo = /path/to/command -with args
[daemons]
; enable SSL support by uncommenting the following line and supply the PEM's below.
; the default ssl port CouchDB listens on is 6984
; httpsd = {couch_httpd, start_link, [https]}
[ssl]
;cert_file = /full/path/to/server_cert.pem
;key_file = /full/path/to/server_key.pem
;password = somepassword
; set to true to validate peer certificates
verify_ssl_certificates = false
; Path to file containing PEM encoded CA certificates (trusted
; certificates used for verifying a peer certificate). May be omitted if
; you do not want to verify the peer.
;cacert_file = /full/path/to/cacertf
; The verification fun (optional) if not specified, the default
; verification fun will be used.
;verify_fun = {Module, VerifyFun}
; maximum peer certificate depth
ssl_certificate_max_depth = 1
; To enable Virtual Hosts in CouchDB, add a vhost = path directive. All requests to
; the Virual Host will be redirected to the path. In the example below all requests
; to http://example.com/ are redirected to /database.
; If you run CouchDB on a specific port, include the port number in the vhost:
; example.com:5984 = /database
[vhosts]
;example.com = /database/
[update_notification]
;unique notifier name=/full/path/to/exe -with "cmd line arg"
; To create an admin account uncomment the '[admins]' section below and add a
; line in the format 'username = password'. When you next start CouchDB, it
; will change the password to a hash (so that your passwords don't linger
; around in plain-text files). You can add more admin accounts with more
; 'username = password' lines. Don't forget to restart CouchDB after
; changing this.
[admins]
;admin = mysecretpassword
:更新:
运行时:
netstat -a -n | grep 5984
我得到:
tcp 0 0 127.0.0.1:5984 0.0.0.0:* LISTEN
127.0.0.1
但应该是 0.0.0.0
因为我已经在 etc/couchdb/local.ini
中设置了绑定(bind)etc/couchdb/default.ini
为 0.0.0.0。
看起来 couchdb 正在从其他地方获取它的设置?当我运行时:
couchdb -c
我得到:
/usr/local/etc/couchdb/default.ini
/usr/local/etc/couchdb/local.ini
当通过 SSH 连接到 AWS 实例时,根目录包含两个条目:
apache-couchdb-1.6.1 apache-couchdb-1.6.1.tar.gz
我 cd
到 apache-couchdb-1.6.1
并编辑 ini 文件:
vim etc/couchdb/local.ini
我认为这与/usr/local/etc/couchdb/local.ini
相同?
我已停止并重新启动 couchdb 并重新启动 AWS 实例,但 couchdb 仍然没有从配置文件中获取绑定(bind)地址。
已排序
事实证明,/usr/local/etc/couchdb/local.ini
与etc/couchdb/local.ini
不同。当我将绑定(bind)放入正确的 ini 时,一切正常!
最佳答案
要使其在外部可见,只需要做两件事:您应该绑定(bind)外部 IP 地址(在 EC2 实例属性中显示为公共(public) IP)并在防火墙上打开它。所以它必须介于两者之间。
我看到您将绑定(bind)地址更改为 0.0.0.0。这应该通过绑定(bind)所有接口(interface)来解决绑定(bind)步骤。
但是您仍然使用 ssh 使用 localhost 进行连接。那么你就不会检查同样的事情。尝试使用curl进行测试时,尝试使用机器IP地址而不是127.0.0.1。它应该是在 EC2 实例属性中显示为公共(public) IP 的 IP。但如果有疑问,请使用 ifconfig -a
找出您拥有的 IP 地址。您还可以通过运行以下命令 netstat -a -n | grep 5984
来检查它实际绑定(bind)的接口(interface)。 。它必须将 0.0.0.0:5984(或 *:5984)显示为 LISTEN(而不是 127.0.0.1:5984)。否则它不会绑定(bind)到正确的端口,您应该检查 CouchDb 配置文件以了解原因。检查 CouchDB 是否真正使用您正在编辑的配置也是值得的。
在防火墙端 - 检查您是否已在正确的安全组上打开它。它必须是您的 EC2 实例的“安全组”属性中显示的规则,并且您打开的规则必须是入站规则。
有时实例防火墙也会介入并引起麻烦。但我只在 Windows 机器上遇到这个问题。我相信它在 AWS Linux 机器上被禁用(至少我从来不需要在那里调整任何东西 - 安全组规则总是足够的)。
如果这仍然不起作用。我只能建议尝试使用 telnet 测试它是否完全连接。由于浏览器有时会错误报告确切的阶段,以使普通用户更简单。使用 telnet 连接是一个较低级别的测试,但请记住,您需要使用 telnet 的空格而不是冒号来分隔端口,例如telnet 1.2.3.4 5984
其中 1.2.3.4 是服务器的 IP 地址。
关于amazon-web-services - 无法使用 URL 访问 AWS 实例上的 CouchDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41704531/
我想知道 Amazon CloudSearch 和 Kendra 之间的主要区别是什么?为什么同一家公司的产品有两种不同的工具相互竞争?两者看起来都一样,我不确定功能有何不同。它是如何相互区分的。 A
我在一家小型电子商务网站工作,我们希望迁移到所有 Amazon 托管服务,但我不确定 RDS 和 SimpleDB 的确切区别。 RDS可以用MySQL,SimpleDB不行吗? 最佳答案 RDS 基
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 7年前关闭。 Improve t
任何人都知道如何 ELB如果我注册多个 EC2 将分发请求不同大小的实例。说一 m1.medium , 一 m1.large和一个 m1.xlarge . 如果我注册EC2会不会不一样相同大小的实例?
Amazon EventBridge 使开发人员能够将第 3 方事件驱动的应用程序与 Amazon 服务连接起来。 Amazon AppFlow 还提供与第 3 方应用程序的事件驱动集成。 对于事件驱
我想通过电子邮件或短信向特定用户(只有一个)发送验证码。我已经通过 Amazon SES 成功地做到了。但我没有尝试通过Amazon SMS然而。我发现自己陷入了调查的兔子洞AWS Pinpoint
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我想使用 Amazon Glacier 镜像 S3 存储桶。 Glacier FAQ状态: Amazon S3 now provides a new storage option that enabl
我正在尝试在 Amazon RDS 上托管数据库,而数据库将存储信息的实际内容(视频)将托管在 Amazon S3 上。我对这个过程有一些疑问,希望有人能帮助我。 Amazon RDS 上托管的数
我刚刚开始使用 AWS EC2。我知道 EC2 就像一台远程计算机,我几乎可以在其中完成我想做的所有事情。后来我知道了ECS。我知道它使用 Docker,但我对这两者之间的关系感到困惑。 ECS 只是
什么时候我会使用 SNS 和 SQS,为什么它们总是耦合在一起? 最佳答案 SNS是一个分布式发布-订阅系统。当发布者将消息发送到 SNS 时,消息就会被推送给订阅者。 SQS是分布式排队系统。消息不
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
我计划在 amazon EC2 中拥有一个多服务器架构,其中服务器需要相互通信。这些服务器需要位于不同的亚马逊地区(不同的数据中心)。我可以只使用亚马逊ec2的内部网络吗?有哪些安全问题?我是否应该在
我在帐户 B 中有 S3 存储桶“跨存储桶”。现在我希望帐户 A 中存在的 EC2 访问帐户 B 中的此存储桶“跨存储桶”。 我需要使用 IAM 角色来实现此目的,因为我们不允许创建用户。 我已使用以
我有使用 Backbone.js 构建的单页应用程序。 我在 Amazon S3 上托管应用程序(应用程序仅包含静态文件)。 我使用 CloudFront 作为 Bucket CDN。 应用程序通过
我可以连接到 ElastiCache来自 EC2 实例 的 VPC 中的 Redis 实例。但我想知道是否有办法连接到 Amazon EC2 实例之外的 ElastiCache Redis 节点,例如
我有几个微实例可以正常工作数周。两者都在运行WordPress博客。在过去的24小时内,其中一个已经停止。即使重新启动,我也无法插入。另一个实例工作正常。 ssh: connect to host e
我尝试了以下方法: SELECT * FROM generate_series(2,4); generate_series ----------------- 2
如何使用PHP API将包含子文件夹和文件的文件夹复制/复制到S3存储桶中的另一个目录中? $s3->copy_object仅复制文件夹,而不复制其中的文件和子文件夹。 我是否必须使用$s3->lis
我是一名优秀的程序员,十分优秀!