2016-09-23 30 views
0

配置我的羣集後,使用cuchbase Rest API,當我想添加新節點,然後重新平衡時,我一直有問題。Couchbase重新平衡不匹配

這裏什麼I'm做

機器創建帳戶和機羣

createAccount(){ 
    ip=$1 
    curl -s -u ${USER}:${PASSWORD} -X POST http://${ip}:8091/pools/default -d memoryQuota=${QUOTA} } 

createCluster(){ 
    ip=$1 
    # Initialize Node 
    curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/nodes/self/controller/settings \ 
     -d 'data_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata& \ 
     index_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata' 

    # Rename Node 
    curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/node/controller/rename \ 
     -d 'hostname=127.0.0.1' 

    # Setup Services 
    curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/node/controller/setupServices \ 
     -d 'services=kv%2Cn1ql%2Cindex' 

    # Setup Administrator username and password 
    curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/settings/web \ 
     -d "password=$PASSWORD&username=$USER&port=SAME" 

} 

創建機器B(上述情況相同的腳本)

然後加入服務器B帳戶和集羣呼叫服務器A

addServer(){ 
    curl -u ${USER}:${PASSWORD} http://A:8091/controller/addNode \ 
      -d "hostname=B&user=$USER&password=$PASSWORD&services=kv%2Cn1ql%2Cindex" 

} 

然後我可以看到如何在A和B服務器我有B等待重新平衡。 但是,當我試圖重新平衡調用

rebalance(){ 
    masterIp=$1 
    couchbaseNode=$2 
    curl -v -u ${USER}:${PASSWORD} -X POST http://A:8091/controller/rebalance \ 
    -d "[email protected], [email protected]" 
} 

服務器返回

{"mismatch":1} 

做錯了什麼I'm?

問候

編輯:

這是HTTP的堆棧給予額外的信息

第一臺機器

----- CREATING COUCHBASE CLUSTER ON 172.31.35.67 
* Trying 172.31.35.67... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /nodes/self/controller/settings HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.35.67:8091 
> Accept: */* 
> Content-Length: 129 
> Content-Type: application/x-www-form-urlencoded 
> 
} [129 bytes data] 
* upload completely sent off: 129 out of 129 bytes 

100 129 0  0 100 129  0 107 0:00:01 0:00:01 --:--:-- 107< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:27:59 GMT 
< Content-Length: 0 
< Cache-Control: no-cache 
< 

100 129 0  0 100 129  0  79 0:00:01 0:00:01 --:--:-- 80 
* Connection #0 to host 172.31.35.67 left intact 
* Trying 172.31.35.67... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /node/controller/rename HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.35.67:8091 
> Accept: */* 
> Content-Length: 18 
> Content-Type: application/x-www-form-urlencoded 
> 
} [18 bytes data] 
* upload completely sent off: 18 out of 18 bytes 
< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:27:59 GMT 
< Content-Length: 0 
< Cache-Control: no-cache 
< 

100 18 0  0 100 18  0 5253 --:--:-- --:--:-- --:--:-- 6000 
* Connection #0 to host 172.31.35.67 left intact 
* Trying 172.31.35.67... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /node/controller/setupServices HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.35.67:8091 
> Accept: */* 
> Content-Length: 26 
> Content-Type: application/x-www-form-urlencoded 
> 
} [26 bytes data] 
* upload completely sent off: 26 out of 26 bytes 
< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:27:59 GMT 
< Content-Length: 0 
< Cache-Control: no-cache 
< 

100 26 0  0 100 26  0 3992 --:--:-- --:--:-- --:--:-- 4333 
* Connection #0 to host 172.31.35.67 left intact 
* Trying 172.31.35.67... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /settings/web HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.35.67:8091 
> Accept: */* 
> Content-Length: 50 
> Content-Type: application/x-www-form-urlencoded 
> 
} [50 bytes data] 
* upload completely sent off: 50 out of 50 bytes 
< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:27:59 GMT 
< Content-Type: application/json 
< Content-Length: 42 
< Cache-Control: no-cache 
< 
{ [42 bytes data] 

二機

Trying 172.31.134.213... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /nodes/self/controller/settings HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.134.213:8091 
> Accept: */* 
> Content-Length: 129 
> Content-Type: application/x-www-form-urlencoded 
> 
} [129 bytes data] 
* upload completely sent off: 129 out of 129 bytes 
100 129 0  0 100 129  0 107 0:00:01 0:00:01 --:--:-- 107< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:34:03 GMT 
< Content-Length: 0 
< Cache-Control: no-cache 
< 

100 129 0  0 100 129  0  81 0:00:01 0:00:01 --:--:-- 81 
* Connection #0 to host 172.31.134.213 left intact 
* Trying 172.31.134.213... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /node/controller/rename HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.134.213:8091 
> Accept: */* 
> Content-Length: 18 
> Content-Type: application/x-www-form-urlencoded 
> 
} [18 bytes data] 
* upload completely sent off: 18 out of 18 bytes 
< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:34:03 GMT 
< Content-Length: 0 
< Cache-Control: no-cache 
< 

100 18 0  0 100 18  0 1976 --:--:-- --:--:-- --:--:-- 2000 
* Connection #0 to host 172.31.134.213 left intact 
* Trying 172.31.134.213... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /node/controller/setupServices HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.134.213:8091 
> Accept: */* 
> Content-Length: 26 
> Content-Type: application/x-www-form-urlencoded 
> 
} [26 bytes data] 
* upload completely sent off: 26 out of 26 bytes 
< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:34:03 GMT 
< Content-Length: 0 
< Cache-Control: no-cache 
< 

100 26 0  0 100 26  0 9626 --:--:-- --:--:-- --:--:-- 13000 
* Connection #0 to host 172.31.134.213 left intact 
* Trying 172.31.134.213... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /settings/web HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.134.213:8091 
> Accept: */* 
> Content-Length: 50 
> Content-Type: application/x-www-form-urlencoded 
> 
} [50 bytes data] 
* upload completely sent off: 50 out of 50 bytes 
< HTTP/1.1 200 OK 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:34:03 GMT 
< Content-Type: application/json 
< Content-Length: 44 
< Cache-Control: no-cache 
< 
{ [44 bytes data] 

100 94 100 44 100 50 15422 17525 --:--:-- --:--:-- --:--:-- 25000 
* Connection #0 to host 172.31.134.213 left intact 
{"newBaseUri":"http://172.31.134.213:8091/"}----- ADD NODE 172.31.134.213 IN COUCHBASE CLUSTER 172.31.35.67 
masterID:172.31.35.67 
node:172.31.134.213 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
100 87 0  0 100 87  0 55769 --:--:-- --:--:-- --:--:-- 43500 
32 268 0  0 100 87  0  81 0:00:01 0:00:01 --:--:-- 81 
100 268 100 181 100 87 169  81 0:00:01 0:00:01 --:--:-- 169 
["Join completion call failed. Got HTTP status 500 from REST call post to http://172.31.134.213:8091/completeJoin. Body was: \"[\\\"Unexpected server error, request logged.\\\"]\""]----- REBALANCING NODE 172.31.134.213 IN COUCHBASE CLUSTER 172.31.35.67 
* Trying 172.31.35.67... 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0) 
* Server auth using Basic with user 'Administrator' 
> POST /controller/rebalance HTTP/1.1 
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg== 
> User-Agent: curl/7.40.0 
> Host: 172.31.35.67:8091 
> Accept: */* 
> Content-Length: 30 
> Content-Type: application/x-www-form-urlencoded 
> 
} [30 bytes data] 
* upload completely sent off: 30 out of 30 bytes 
< HTTP/1.1 400 Bad Request 
< Server: Couchbase Server 
< Pragma: no-cache 
< Date: Tue, 27 Sep 2016 09:34:04 GMT 
< Content-Type: application/json 
< Content-Length: 14 
< Cache-Control: no-cache 
< 
{ [14 bytes data] 

100 44 100 14 100 30 11965 25641 --:--:-- --:--:-- --:--:-- 30000 
* Connection #0 to host 172.31.35.67 left intact 
{"mismatch":1} 

正如您所看到的最後一個請求失敗,並顯示400代碼

+0

你能顯示原始的http請求和響應嗎?這可能有助於弄清楚調用中傳遞的是錯誤的信息。此外,這與CouchDB無關,所以您應該刪除該標記。 – Kirk

+0

@Kirk我只是添加了http請求響應的細節,你爲什麼認爲不是與couchbase相關的? – paul

+0

我說它不是CouchDB相關的原因是CouchDB和Couchbase是兩個獨立的產品。我沒有看到你的電話無法工作的原因。你正在運行什麼版本的Couchbase,所以我可以嘗試並複製這個問題。 – Kirk

回答

1

在knownNodes列表中,刪除節點之間的空格。我能夠複製它。用空格{「mismatch」:1}。沒有空格,它就可以工作。

我在這個問題上的文檔中打開了一個錯誤。