2017-04-21 124 views
1

我是Mobile Android上的couchbaselite数据库的全新功能。我在与服务器有关的问题。我从https://developer.couchbase.com/documentation/mobile/current/training/develop/adding-synchronization/index.html无法在127.0.0.1:4985上启动http服务器

在这里,我已经做了一切正确像CD C下载的项目:\程序文件(x86)\ Couchbase \ sync_gateway.exe同步网关config.json这里的错误来了,如:

FATAL: Failed to start HTTP server on 127.0.0.1:4985: listen tcp 
127.0.0.1:4985: bind: Only one usage of each socket address (protocol/network address/port) 
is normally permitted. -- rest.(*ServerConfig).Serve() at config.go:705 

而且在我的Android工作室:

http://localhost:4984/sync_gateway/_local/d7b1dc31d5dc922ea4253245dcf077660540331d

通过点击这个链接我得到{ “错误” 上: “NOT_FOUND”,”理由 “:” 失踪 “}

并以此http://localhost:4984/sync_gateway我得到

{” committed_update_seq “:3,” compact_running “:假的,” DB_NAME “:” sync_gateway”, “disk_format_version”:0 “instance_start_time”:1492768709992675, “purge_seq”:0, “状态”: “在线”, “update_seq”:3}

我想移动之间添加同步和couchdatabase

预先感谢您。

回答

0

我想你在这里有两个问题。

启动Sync Gateway时出现的第一个错误表示应用程序已在使用端口4985.您需要确保您没有运行Sync Gateway实例。如果有不同的应用程序已经在使用该端口,则可以停止它或更改Sync Gateway使用的端口。 (你可以在配置文件中轻松完成。)

我不太清楚你想通过与Android Studio谈论的链接来做什么。但是,了解要访问运行在与仿真器相同的机器上的应用程序时,需要使用不同的IP地址,这一点很重要。如果您使用的是标准Android模拟器,则需要使用10.0.2.2来代替localhost。看到这个SO帖子的详细信息:How to connect to my http://localhost web server from Android Emulator in Eclipse