代码之家  ›  专栏  ›  技术社区  ›  Yvonne Aburrow

如何在谷歌AppEngine平台上访问Fauxton?

  •  3
  • Yvonne Aburrow  · 技术社区  · 8 年前

    我正在Google app Engine上创建一个离线的第一个应用程序,PouchDB作为我的本地DB,CouchDB作为我的远程DB。我在Google AppEngine上启用了CouchDB,并尝试转到以下URL:

    https://[my-app-id].appspot.com:5984/_utils/
    

    当我这样做时,我得到以下信息:

    This site can’t be reached
    The connection was reset.
    Try:
    Checking the connection
    Checking the proxy and the firewall
    Running Windows Network Diagnostics
    ERR_CONNECTION_RESET
    

    所以我试着启用 https 访问防火墙设置。

    **Firewalls**
    [ ] Allow HTTP traffic
    [Y] Allow HTTPS traffic
    

    仍然存在上述错误。

    我搜索了文档,但没有找到任何关于如何在谷歌AppEngine上访问Fauxton(或Futon)的有用信息。(说明书只告诉您 how to access Fauxton on your local machine .)

    我有 generated a private and public key and logged in to the server via command line .

    我也遵循了 instructions about configuring the firewall to allow remote access ,并仅将其交给我的电脑。

    https://[my-app-id].appspot.com:5984/_utils/

    如何在谷歌AppEngine平台上访问Fauxton?


    使现代化 :根据我浏览器中的开发工具,我的PouchDB应用程序已成功创建了一个要同步的数据库,但它不在服务器上:

    screenshot of IndexedDB in Application tab

    应用程序。yaml文件

    application: [app-name]
    version: 4
    runtime: python27
    api_version: 1
    threadsafe: false
    
    handlers:
    
    - url: /
      script: main.py
    
    - url: /(favicon)\.ico$
      static_files: \1.ico
      upload: /(favicon)\.ico
      application_readable: true
    
    - url: /(package)\.json$
      static_files: \1.json
      upload: /(package)\.json
      application_readable: true
    
      # Serve images as static resources #
    - url: /(.+\.(gif|png|jpg|json|ico))$
      static_files: \1
      upload: .+\.(gif|png|jpg|json|ico)$
      application_readable: true
    
    
    - url: /index.html
      static_files: index.html
      upload: index.html 
    
    - url: /licence.html
      static_files: licence.html
      upload: licence.html 
    
    - url: /privacy.html
      static_files: privacy.html
      upload: privacy.html 
    
    - url: /pouchnotes.manifest
      static_files: pouchnotes.manifest
      upload: pouchnotes.manifest  
    
    - url: /manifest.json
      static_files: manifest.json
      upload: manifest.json
    
      # static directories #
    
    - url: /img
      static_dir: img
    
    - url: /js
      static_dir: js
    
    - url: /css
      static_dir: css
    
    
    libraries:
    - name: webapp2
      version: "2.5.2"
    

    编辑 : I posted this question in the Bitnami community forum (他们在谷歌应用程序引擎上提供CouchDB)

    2 回复  |  直到 8 年前
        1
  •  1
  •   Dan Cornilescu    8 年前

    FWIW,你帖子中的一个引用指向谷歌计算引擎(GCE),它是一个IaaS,而不是像谷歌应用程序引擎(GAE)那样的PaaS,你 可以 看错了产品。

    这个 app.yaml Limitations and restrictions :

    虽然App Engine支持套接字,但也有一定的局限性

    • 无法创建侦听套接字;只能创建出站套接字。

    GAE灵活的环境 可以 significantly different 解决方案(我还没有使用)。答案的其余部分假设环境灵活,并且仅基于文档。

    不是百分之百确定,但你 可以 需要教你的应用程序听8080端口。从…起 Listen to port 8080

    应用引擎前端将传入请求路由到 端口8080上的适当模块。你必须确保你的 应用程序代码正在8080上侦听。

    除非你可以使用 forwarded ports 网络配置(同样,不是百分之百确定,我没有使用flex env)。从…起 Port forwarding

    端口转发允许直接连接到Docker容器 在您的实例中。该流量可以通过任何协议传输。港口城市 转发旨在帮助您应对可能需要的情况 附加调试器或探查器。

    默认情况下,不允许来自网络外部的传入流量 通过 Google Cloud Platform firewalls . 在你完成之后 在您的 应用程序。亚马尔 文件,您必须添加 允许来自您想要打开的端口的流量的防火墙规则。

    您可以在网络防火墙规则页面中指定防火墙规则 在 Google Cloud Platform Console using gcloud commands .

    2222 :

    1. 修改 包括:

      entrypoint: gunicorn -b :$PORT -b :2222 main:app
      
    2. 在您的 应用程序。亚马尔 ,包括:

      network:
        forwarded_ports:
         - 2222/tcp
      
    3. 在中指定防火墙规则 Cloud Platform Console 或使用 gcloud compute firewall-rules create 允许来自任何 来源( 0.0.0.0/0 )和来自 tcp:2222 .

        2
  •  1
  •   Yvonne Aburrow    8 年前

    我正在买一些 help with this from the Bitnami Community Forum .

    到目前为止的答案。。。

    (1) set up the firewall rules -确保你有一个 permanent IP address 为了这个。

    SSH keys to access the server via command line

    (3) sudo /opt/bitnami/couchdb/scripts/ctl.sh stop couchdb

    (4) edit local.ini to point to 0.0.0.0 instead of 127.0.0.1 cd /opt/bitnami/couchdb/etc/ ,按enter,然后 sudo vi local.ini (而不是 vi local.ini 如说明所示)。

    (5) Log in to the external IP address . (以身份登录 admin 并将命令前缀为 sudo )

    (注意:您不需要在GAE灵活的环境中运行此功能)

    推荐文章