2017-04-21 231 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