nginx-upsync-module icon indicating copy to clipboard operation
nginx-upsync-module copied to clipboard

是否支持etcd v3版本的接口

Open workhardcc opened this issue 10 years ago • 17 comments

2016/07/08 20:21:41 [error] 26126#0: recv() failed (104: Connection reset by peer)
2016/07/08 20:21:41 [error] 26126#0: upsync_recv: recv error with upsync_server: 10.93.79.49:4001
2016/07/08 20:21:42 [error] 26126#0: recv() failed (104: Connection reset by peer)
2016/07/08 20:21:42 [error] 26126#0: upsync_recv: recv error with upsync_server: 10.93.79.49:4001
2016/07/08 20:21:44 [error] 26126#0: recv() failed (104: Connection reset by peer)
2016/07/08 20:21:44 [error] 26126#0: upsync_recv: recv error with upsync_server: 10.93.79.49:4001
2016/07/08 20:21:44 [error] 26126#0: recv() failed (104: Connection reset by peer)
2016/07/08 20:21:44 [error] 26126#0: upsync_recv: recv error with upsync_server: 10.93.79.49:4001

最近更新了etcd,从V2版本更新到了V3,然后nginx就大量报错了。尝试更新了etcd的内容(如更新某个upstream机器的weight=2),upstream_show显示还是能正确更新,请问该如何排查一下?

workhardcc avatar Jul 08 '16 12:07 workhardcc

麻烦tcpdump 一下,是不是网络出了问题

xiaokai-wang avatar Jul 10 '16 14:07 xiaokai-wang

etcd:

10:31:53.691186 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [S], seq 963300267, win 29200, options [mss 1460,sackOK,TS val 2309478966 ecr 0,nop,wscale 7], length 0
10:31:53.691199 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [S.], seq 776050912, ack 963300268, win 28960, options [mss 1460,sackOK,TS val 3816320378 ecr 2309478966,nop,wscale 7], length 0
10:31:53.691230 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [.], ack 1, win 229, options [nop,nop,TS val 2309478966 ecr 3816320378], length 0
10:31:53.691254 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [P.], seq 1:129, ack 1, win 229, options [nop,nop,TS val 2309478966 ecr 3816320378], length 128
10:31:53.691260 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [.], ack 129, win 235, options [nop,nop,TS val 3816320378 ecr 2309478966], length 0
10:31:53.691588 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [P.], seq 1:190, ack 129, win 235, options [nop,nop,TS val 3816320378 ecr 2309478966], length 189
10:31:53.691614 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [.], ack 190, win 237, options [nop,nop,TS val 2309478966 ecr 3816320378], length 0
10:31:53.691643 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [P.], seq 129:257, ack 190, win 237, options [nop,nop,TS val 2309478966 ecr 3816320378], length 128
10:31:53.691691 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [R.], seq 190, ack 257, win 243, options [nop,nop,TS val 0 ecr 2309478966], length 0

nginx:

10:31:53.652196 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [S], seq 963300267, win 29200, options [mss 1460,sackOK,TS val 2309478966 ecr 0,nop,wscale 7], length 0
10:31:53.652236 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [S.], seq 776050912, ack 963300268, win 28960, options [mss 1460,sackOK,TS val 3816320378 ecr 2309478966,nop,wscale 7], length 0
10:31:53.652249 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [.], ack 1, win 229, options [nop,nop,TS val 2309478966 ecr 3816320378], length 0
10:31:53.652264 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [P.], seq 1:129, ack 1, win 229, options [nop,nop,TS val 2309478966 ecr 3816320378], length 128
10:31:53.652322 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [.], ack 129, win 235, options [nop,nop,TS val 3816320378 ecr 2309478966], length 0
10:31:53.652627 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [P.], seq 1:190, ack 129, win 235, options [nop,nop,TS val 3816320378 ecr 2309478966], length 189
10:31:53.652633 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [.], ack 190, win 237, options [nop,nop,TS val 2309478966 ecr 3816320378], length 0
10:31:53.652656 IP 10.93.79.42.52575 > 10.93.79.49.4001: Flags [P.], seq 129:257, ack 190, win 237, options [nop,nop,TS val 2309478966 ecr 3816320378], length 128
10:31:53.652734 IP 10.93.79.49.4001 > 10.93.79.42.52575: Flags [R.], seq 190, ack 257, win 243, options [nop,nop,TS val 0 ecr 2309478966], length 0

不太明白为什么为什么最后一条是一个 [R.],etcd reset了连接,是连接超时机制什么的吗?

workhardcc avatar Jul 11 '16 02:07 workhardcc

从时间上来看,跟超时没有关系;你看一下他们的交互内容,从上面信息上看交互顺序出现了问题,nginx还没有发完request,然而etcd 已开始response,之后当做错误处理了?

xiaokai-wang avatar Jul 11 '16 06:07 xiaokai-wang

I don't see the data in the dump, but I was having the same issue, never managed to track down why - with etcd v2.3.x.

When I stuck ETCD Proxy inbetween (which was final goal anyways, to add in SSL layer and spread the load etc) it was suddenly fine.

CallMeFoxie avatar Jul 11 '16 06:07 CallMeFoxie

我在etcd v2.2 版本上测试没有这个问题

etcd Version: 2.2.5
Git SHA: bc9ddf2
Go Version: go1.4.2
Go OS/Arch: linux/amd64

compare

etcd Version: 3.0.1
Git SHA: a4a52cb
Go Version: go1.6.2
Go OS/Arch: linux/amd64

workhardcc avatar Jul 11 '16 07:07 workhardcc

etcd:

16:10:55.276214 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [S], seq 159084349, win 29200, options [mss 1460,sackOK,TS val 2329820601 ecr 0,nop,wscale 7], length 0
        0x0000:  0000 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 003c 0dd5 0000 4006 b9d2 0a5d 4f2a  E..<....@....]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6f3d 0000 0000  .]O1.....{o=....
        0x0030:  a002 7210 50f7 0000 0204 05b4 0402 080a  ..r.P...........
        0x0040:  8ade 3db9 0000 0000 0103 0307 0000 0000  ..=.............
        0x0050:  0000 0000 0000 0000 0000 0000            ............
16:10:55.276227 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [S.], seq 701011936, ack 159084350, win 28960, options [mss 1460,sackOK,TS val 3836661963 ecr 2329820601,nop,wscale 7], length
 0
        0x0000:  0004 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 003c c030 0000 4006 0777 0a5d 4f31  E..<[email protected].]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 97e0 097b 6f3e  .]O*....)....{o>
        0x0030:  a012 7120 b343 0000 0204 05b4 0402 080a  ..q..C..........
        0x0040:  e4ae d0cb 8ade 3db9 0103 0307 0000 0000  ......=.........
        0x0050:  0000 0000 0000 0000 0000 0000            ............
16:10:55.276291 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [.], ack 1, win 229, options [nop,nop,TS val 2329820601 ecr 3836661963], length 0
        0x0000:  0000 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 0034 0dd6 0000 4006 b9d9 0a5d 4f2a  E..4....@....]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6f3e 29c8 97e1  .]O1.....{o>)...
        0x0030:  8010 00e5 79ba 0000 0101 080a 8ade 3db9  ....y.........=.
        0x0040:  e4ae d0cb 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000                                ....
16:10:55.276315 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [P.], seq 1:129, ack 1, win 229, options [nop,nop,TS val 2329820601 ecr 3836661963], length 128
        0x0000:  0000 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 00b4 0dd7 0000 4006 b958 0a5d 4f2a  [email protected].]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6f3e 29c8 97e1  .]O1.....{o>)...
        0x0030:  8018 00e5 1650 0000 0101 080a 8ade 3db9  .....P........=.
        0x0040:  e4ae d0cb 4745 5420 2f76 322f 6b65 7973  ....GET./v2/keys
        0x0050:  2f75 7073 7472 6561 6d73 2f6b 3873 5f75  /upstreams/k8s_u
        0x0060:  7073 7472 6561 6d3f 7761 6974 3d74 7275  pstream?wait=tru
        0x0070:  6526 7265 6375 7273 6976 653d 7472 7565  e&recursive=true
        0x0080:  2677 6169 7449 6e64 6578 3d33 3039 3135  &waitIndex=30915
        0x0090:  3034 2048 5454 502f 312e 300d 0a48 6f73  04.HTTP/1.0..Hos
        0x00a0:  743a 2031 302e 3933 2e37 392e 3439 3a34  t:.10.93.79.49:4
        0x00b0:  3030 310d 0a41 6363 6570 743a 202a 2f2a  001..Accept:.*/*
        0x00c0:  0d0a 0d0a 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000                                ....
16:10:55.276321 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [.], ack 129, win 235, options [nop,nop,TS val 3836661963 ecr 2329820601], length 0
        0x0000:  0004 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 0034 c031 0000 4006 077e 0a5d 4f31  E..4.1..@..~.]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 97e1 097b 6fbe  .]O*....)....{o.
        0x0030:  8010 00eb b33b 0000 0101 080a e4ae d0cb  .....;..........
        0x0040:  8ade 3db9 0000 0000 0000 0000 0000 0000  ..=.............
        0x0050:  0000 0000                                ....
16:10:55.276692 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [P.], seq 1:190, ack 129, win 235, options [nop,nop,TS val 3836661963 ecr 2329820601], length 189
        0x0000:  0004 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 00f1 c032 0000 4006 06c0 0a5d 4f31  E....2..@....]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 97e1 097b 6fbe  .]O*....)....{o.
        0x0030:  8018 00eb b3f8 0000 0101 080a e4ae d0cb  ................
        0x0040:  8ade 3db9 4854 5450 2f31 2e30 2032 3030  ..=.HTTP/1.0.200
        0x0050:  204f 4b0d 0a43 6f6e 7465 6e74 2d54 7970  .OK..Content-Typ
        0x0060:  653a 2061 7070 6c69 6361 7469 6f6e 2f6a  e:.application/j
        0x0070:  736f 6e0d 0a58 2d45 7463 642d 436c 7573  son..X-Etcd-Clus
        0x0080:  7465 722d 4964 3a20 3765 3935 3134 3863  ter-Id:.7e95148c
        0x0090:  3162 3436 3462 6237 0d0a 582d 4574 6364  1b464bb7..X-Etcd
        0x00a0:  2d49 6e64 6578 3a20 3330 3931 3537 370d  -Index:.3091577.
        0x00b0:  0a58 2d52 6166 742d 496e 6465 783a 2038  .X-Raft-Index:.8
        0x00c0:  3130 3739 3935 0d0a 582d 5261 6674 2d54  107995..X-Raft-T
        0x00d0:  6572 6d3a 2031 3031 0d0a 4461 7465 3a20  erm:.101..Date:.
        0x00e0:  4d6f 6e2c 2031 3120 4a75 6c20 3230 3136  Mon,.11.Jul.2016
        0x00f0:  2030 383a 3130 3a35 3520 474d 540d 0a0d  .08:10:55.GMT...
        0x0100:  0aca 0102 4852 1a02 db15 25da d67e be78  ....HR....%..~.x
        0x0110:  a3                                       .
16:10:55.276726 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [.], ack 190, win 237, options [nop,nop,TS val 2329820602 ecr 3836661963], length 0
        0x0000:  0000 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 0034 0dd8 0000 4006 b9d7 0a5d 4f2a  E..4....@....]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6fbe 29c8 989e  .]O1.....{o.)...
        0x0030:  8010 00ed 7874 0000 0101 080a 8ade 3dba  ....xt........=.
        0x0040:  e4ae d0cb 0000 0000 0103 0307 0000 0000  ................
        0x0050:  0000 0000                                ....
16:10:55.276761 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [P.], seq 129:257, ack 190, win 237, options [nop,nop,TS val 2329820602 ecr 3836661963], length 128
        0x0000:  0000 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 00b4 0dd9 0000 4006 b956 0a5d 4f2a  [email protected].]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6fbe 29c8 989e  .]O1.....{o.)...
        0x0030:  8018 00ed 150a 0000 0101 080a 8ade 3dba  ..............=.
        0x0040:  e4ae d0cb 4745 5420 2f76 322f 6b65 7973  ....GET./v2/keys
        0x0050:  2f75 7073 7472 6561 6d73 2f6b 3873 5f75  /upstreams/k8s_u
        0x0060:  7073 7472 6561 6d3f 7761 6974 3d74 7275  pstream?wait=tru
        0x0070:  6526 7265 6375 7273 6976 653d 7472 7565  e&recursive=true
        0x0080:  2677 6169 7449 6e64 6578 3d33 3039 3135  &waitIndex=30915
        0x0090:  3034 2048 5454 502f 312e 300d 0a48 6f73  04.HTTP/1.0..Hos
        0x00a0:  743a 2031 302e 3933 2e37 392e 3439 3a34  t:.10.93.79.49:4
        0x00b0:  3030 310d 0a41 6363 6570 743a 202a 2f2a  001..Accept:.*/*
        0x00c0:  0d0a 0d0a 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000                                ....
16:10:55.276815 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [R.], seq 190, ack 257, win 243, options [nop,nop,TS val 0 ecr 2329820602], length 0
        0x0000:  0004 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 0034 c033 0000 4006 077c 0a5d 4f31  E..4.3..@..|.]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 989e 097b 703e  .]O*....)....{p>
        0x0030:  8014 00f3 b33b 0000 0101 080a 0000 0000  .....;..........
        0x0040:  8ade 3dba 0000 0000 0103 0307 0000 0000  ..=.............
        0x0050:  0000 0000                                ....

nginx:

16:10:55.287813 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [S], seq 159084349, win 29200, options [mss 1460,sackOK,TS val 2329820601 ecr 0,nop,wscale 7], length 0
        0x0000:  0004 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 003c 0dd5 0000 4006 b9d2 0a5d 4f2a  E..<....@....]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6f3d 0000 0000  .]O1.....{o=....
        0x0030:  a002 7210 b343 0000 0204 05b4 0402 080a  ..r..C..........
        0x0040:  8ade 3db9 0000 0000 0103 0307 0000 0000  ..=.............
        0x0050:  0000 0000 0000 0000 0000 0000            ............
16:10:55.287882 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [S.], seq 701011936, ack 159084350, win 28960, options [mss 1460,sackOK,TS val 3836661963 ecr 2329820601,nop,wscale 7], length 0
        0x0000:  0000 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 003c c030 0000 4006 0777 0a5d 4f31  E..<[email protected].]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 97e0 097b 6f3e  .]O*....)....{o>
        0x0030:  a012 7120 dab2 0000 0204 05b4 0402 080a  ..q.............
        0x0040:  e4ae d0cb 8ade 3db9 0103 0307 0000 0000  ......=.........
        0x0050:  0000 0000 0000 0000 0000 0000            ............
16:10:55.287901 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [.], ack 1, win 229, options [nop,nop,TS val 2329820601 ecr 3836661963], length 0
        0x0000:  0004 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 0034 0dd6 0000 4006 b9d9 0a5d 4f2a  E..4....@....]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6f3e 29c8 97e1  .]O1.....{o>)...
        0x0030:  8010 00e5 b33b 0000 0101 080a 8ade 3db9  .....;........=.
        0x0040:  e4ae d0cb 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000                                ....
16:10:55.287925 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [P.], seq 1:129, ack 1, win 229, options [nop,nop,TS val 2329820601 ecr 3836661963], length 128
        0x0000:  0004 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 00b4 0dd7 0000 4006 b958 0a5d 4f2a  [email protected].]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6f3e 29c8 97e1  .]O1.....{o>)...
        0x0030:  8018 00e5 b3bb 0000 0101 080a 8ade 3db9  ..............=.
        0x0040:  e4ae d0cb 4745 5420 2f76 322f 6b65 7973  ....GET./v2/keys
        0x0050:  2f75 7073 7472 6561 6d73 2f6b 3873 5f75  /upstreams/k8s_u
        0x0060:  7073 7472 6561 6d3f 7761 6974 3d74 7275  pstream?wait=tru
        0x0070:  6526 7265 6375 7273 6976 653d 7472 7565  e&recursive=true
        0x0080:  2677 6169 7449 6e64 6578 3d33 3039 3135  &waitIndex=30915
        0x0090:  3034 2048 5454 502f 312e 300d 0a48 6f73  04.HTTP/1.0..Hos
        0x00a0:  743a 2031 302e 3933 2e37 392e 3439 3a34  t:.10.93.79.49:4
        0x00b0:  3030 310d 0a41 6363 6570 743a 202a 2f2a  001..Accept:.*/*
        0x00c0:  0d0a 0d0a 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000                                ....
16:10:55.287951 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [.], ack 129, win 235, options [nop,nop,TS val 3836661963 ecr 2329820601], length 0
        0x0000:  0000 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 0034 c031 0000 4006 077e 0a5d 4f31  E..4.1..@..~.]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 97e1 097b 6fbe  .]O*....)....{o.
        0x0030:  8010 00eb 7934 0000 0101 080a e4ae d0cb  ....y4..........
        0x0040:  8ade 3db9 0000 0000 0000 0000 0000 0000  ..=.............
        0x0050:  0000 0000                                ....
16:10:55.288326 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [P.], seq 1:190, ack 129, win 235, options [nop,nop,TS val 3836661963 ecr 2329820601], length 189
        0x0000:  0000 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 00f1 c032 0000 4006 06c0 0a5d 4f31  E....2..@....]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 97e1 097b 6fbe  .]O*....)....{o.
        0x0030:  8018 00eb a67a 0000 0101 080a e4ae d0cb  .....z..........
        0x0040:  8ade 3db9 4854 5450 2f31 2e30 2032 3030  ..=.HTTP/1.0.200
        0x0050:  204f 4b0d 0a43 6f6e 7465 6e74 2d54 7970  .OK..Content-Typ
        0x0060:  653a 2061 7070 6c69 6361 7469 6f6e 2f6a  e:.application/j
        0x0070:  736f 6e0d 0a58 2d45 7463 642d 436c 7573  son..X-Etcd-Clus
        0x0080:  7465 722d 4964 3a20 3765 3935 3134 3863  ter-Id:.7e95148c
        0x0090:  3162 3436 3462 6237 0d0a 582d 4574 6364  1b464bb7..X-Etcd
        0x00a0:  2d49 6e64 6578 3a20 3330 3931 3537 370d  -Index:.3091577.
        0x00b0:  0a58 2d52 6166 742d 496e 6465 783a 2038  .X-Raft-Index:.8
        0x00c0:  3130 3739 3935 0d0a 582d 5261 6674 2d54  107995..X-Raft-T
        0x00d0:  6572 6d3a 2031 3031 0d0a 4461 7465 3a20  erm:.101..Date:.
        0x00e0:  4d6f 6e2c 2031 3120 4a75 6c20 3230 3136  Mon,.11.Jul.2016
        0x00f0:  2030 383a 3130 3a35 3520 474d 540d 0a0d  .08:10:55.GMT...
        0x0100:  0a00 0000 0000 0000 0000 0000 0000 0000  ................
        0x0110:  00                                       .
16:10:55.288334 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [.], ack 190, win 237, options [nop,nop,TS val 2329820602 ecr 3836661963], length 0
        0x0000:  0004 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 0034 0dd8 0000 4006 b9d7 0a5d 4f2a  E..4....@....]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6fbe 29c8 989e  .]O1.....{o.)...
        0x0030:  8010 00ed b33b 0000 0101 080a 8ade 3dba  .....;........=.
        0x0040:  e4ae d0cb 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000                                ....
16:10:55.288369 IP 10.93.79.42.33010 > 10.93.79.49.4001: Flags [P.], seq 129:257, ack 190, win 237, options [nop,nop,TS val 2329820602 ecr 3836661963], length 128
        0x0000:  0004 0001 0006 6805 ca40 62d8 0000 0800  ......h..@b.....
        0x0010:  4500 00b4 0dd9 0000 4006 b956 0a5d 4f2a  [email protected].]O*
        0x0020:  0a5d 4f31 80f2 0fa1 097b 6fbe 29c8 989e  .]O1.....{o.)...
        0x0030:  8018 00ed b3bb 0000 0101 080a 8ade 3dba  ..............=.
        0x0040:  e4ae d0cb 4745 5420 2f76 322f 6b65 7973  ....GET./v2/keys
        0x0050:  2f75 7073 7472 6561 6d73 2f6b 3873 5f75  /upstreams/k8s_u
        0x0060:  7073 7472 6561 6d3f 7761 6974 3d74 7275  pstream?wait=tru
        0x0070:  6526 7265 6375 7273 6976 653d 7472 7565  e&recursive=true
        0x0080:  2677 6169 7449 6e64 6578 3d33 3039 3135  &waitIndex=30915
        0x0090:  3034 2048 5454 502f 312e 300d 0a48 6f73  04.HTTP/1.0..Hos
        0x00a0:  743a 2031 302e 3933 2e37 392e 3439 3a34  t:.10.93.79.49:4
        0x00b0:  3030 310d 0a41 6363 6570 743a 202a 2f2a  001..Accept:.*/*
        0x00c0:  0d0a 0d0a 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000                                ....
16:10:55.288444 IP 10.93.79.49.4001 > 10.93.79.42.33010: Flags [R.], seq 190, ack 257, win 243, options [nop,nop,TS val 0 ecr 2329820602], length 0
        0x0000:  0000 0001 0006 6805 ca40 62b4 0000 0800  ......h..@b.....
        0x0010:  4500 0034 c033 0000 4006 077c 0a5d 4f31  E..4.3..@..|.]O1
        0x0020:  0a5d 4f2a 0fa1 80f2 29c8 989e 097b 703e  .]O*....)....{p>
        0x0030:  8014 00f3 2d65 0000 0101 080a 0000 0000  ....-e..........
        0x0040:  8ade 3dba 0000 0000 0000 0000 0000 0000  ..=.............
        0x0050:  0000 0000                                ....

workhardcc avatar Jul 11 '16 08:07 workhardcc

etcd 无端reset 了连接,是不是配置出了问题?

据第三方反馈,与新版的etcd 可以正常的兼容;麻烦再检查一下.

xiaokai-wang avatar Jul 11 '16 11:07 xiaokai-wang

hi etcd的配置都是开端口啥的:

ETCD_NAME=node1
ETCD_DATA_DIR="/search/etcd"
ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379,http://0.0.0.0:4001"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.1:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.1:2379"
ETCD_INITIAL_CLUSTER="node1=http://10.0.0.1:2380,node2=http://10.0.0.8:2380,node3=http://10.0.0.7:2380"
#ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_STATE="existing"
ETCD_INITIAL_CLUSTER_TOKEN="k8s-etcd-cluster"

我这的情况是:我只要把/usr/bin/etcd这个bin文件替换成v3版本,重启服务马上就报错,再换回来马上就OK......

workhardcc avatar Jul 11 '16 13:07 workhardcc

已经经过验证 Etcd v3.0.1 +nginx 1.11.1,使用nginx-stream-upsync-module插件,功能正常。 只要etcd的接口和nginx的接口保持兼容的,nginx-upsync-module 插件应当也能正常使用。 下面的是我的配置 stream { upstream grpc_server { # fake server otherwise ngx_stream_upstream will report error when startup server 127.0.0.1:11111;

    # all backend server will pull from etcd when startup and will delete fake server
    upsync 127.0.0.1:2379/v2/keys/upstreams/grpc_server upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off;
    upsync_dump_path /home/etcd/slb_nginx/conf/servers_grpc.conf;
}

server { listen 50051; proxy_pass grpc_server; }

}

kuncao avatar Jul 13 '16 02:07 kuncao

@kuncao 使用nginx-1.10.1、nginx-1.11.2重新测试,报错根本停不下来,安装步骤为: 1.git clone https://github.com/xiaokai-wang/nginx_upstream_check_module.git 2.cd到nginx源码目录:patch -p0 < /search/nginx_upstream_check_module/check_1.9.2+.patch 3../configure --prefix=/usr/local/nginx --add-module=/search/nginx_upstream_check_module --add-module=/search/nginx-upsync-module 4. make && make install

nginx配置为:

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}
http{
 upstream proxy_test {
        # fake server otherwise ngx_http_upstream will report error when startup
        server 127.0.0.1:11111;

        # all backend server will pull from consul when startup and will delete fake server
    upsync 127.0.0.1:2379/v2/keys/upstreams/k8s_upstream  upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off;
    upsync_dump_path /search/nginx/conf/servers/k8s_upstream.conf;
    }


    server {
        listen 8888;

        location = /proxy_test/ {
        rewrite ^/proxy_test/(.*) /$1 break;
            proxy_pass http://proxy_test;
        }

        location = /upstream_show {
            upstream_show;
        }
    }
}

etcd配置为:

ETCD_NAME=node1
ETCD_DATA_DIR="/search/etcd"

ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379,http://0.0.0.0:4001"

ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.93.79.42:2380"

ETCD_ADVERTISE_CLIENT_URLS="http://10.93.79.42:2379"
ETCD_INITIAL_CLUSTER="node1=http://10.93.79.42:2380"
#ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_STATE="existing"
ETCD_INITIAL_CLUSTER_TOKEN="test1"

实在看不出来哪里有错,etcd的安装方式为:先yum install 低版本的etcd 后替换etcd及etcdctl的二进制文件

workhardcc avatar Jul 18 '16 07:07 workhardcc

你这个案例很奇怪;

但是什么只是替换二进制文件?采用这种方式

xiaokai-wang avatar Jul 22 '16 07:07 xiaokai-wang

下载etcd的源码自己编译出来的etcd和etcdctl的可执行文件,或者直接下载社区已经预编译好的可执行文件去替换v2版本的可执行文件,就报错

workhardcc avatar Jul 22 '16 08:07 workhardcc

从之前的dump 信息来看,我不认为是模块的问题;至于etcd 为什么reset,是不是向etcd 反馈一下;

thanks.

xiaokai-wang avatar Jul 22 '16 09:07 xiaokai-wang

又测了一下午,centos6,7全测了,还是一样的问题..... 我现在在etcdv2版本上也出现了同样的问题。这个错毕竟是nginx报出来了,我和etcd反馈没法说啊。 要不您给一份您那的配置和nginx的bin文件我全部照搬试试?

workhardcc avatar Jul 22 '16 12:07 workhardcc

please @CallMeFoxie , any convenience.

xiaokai-wang avatar Jul 22 '16 13:07 xiaokai-wang

我的也是出现了一样的问题

krainz avatar Jul 29 '16 07:07 krainz

It's a bug which has been fixed, even though that doesn't effect the updating.

It is not appeared before, weird. I thought it's ok folly, thanks.

Thanks to report, to insist, really much.

Please update and have a try. @krainz @workhardcc .

Thanks all.

xiaokai-wang avatar Jul 31 '16 02:07 xiaokai-wang