Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream不支持backup参数 #227

Open
neighbour-oldhuang opened this issue Sep 20, 2018 · 5 comments
Open

upstream不支持backup参数 #227

neighbour-oldhuang opened this issue Sep 20, 2018 · 5 comments

Comments

@neighbour-oldhuang
Copy link

@neighbour-oldhuang neighbour-oldhuang commented Sep 20, 2018

consul配置了127.0.0.1:83的参数:
{"backup":1,"weight":2, "max_fails":2, "fail_timeout":10}

状态显示:

Upstream name: myup; Backend server count: 3
        server 127.0.0.1:83 weight=2 max_fails=2 fail_timeout=10s;
        server 127.0.0.1:82 weight=2 max_fails=2 fail_timeout=10s;
        server 127.0.0.1:81 weight=2 max_fails=2 fail_timeout=10s down;

backup没生效

@gfrankliu

This comment has been minimized.

Copy link
Collaborator

@gfrankliu gfrankliu commented Sep 20, 2018

down, backup这两个参数跟其他参数不一样,不需要赋值。

@neighbour-oldhuang

This comment has been minimized.

Copy link
Author

@neighbour-oldhuang neighbour-oldhuang commented Sep 25, 2018

down, backup这两个参数跟其他参数不一样,不需要赋值。

不给值的话 ,upsync会提示 upsync_parse_json: parse '{"weight": 1, "max_fails": 3, "fail_timeout":10, "down":0, "backup"}' failed
backup 或者"backup" 都不行, "down":1 这个是没问题的

@gfrankliu

This comment has been minimized.

Copy link
Collaborator

@gfrankliu gfrankliu commented Oct 21, 2018

I this below in the source:

            //if (server->backup) {
            //    continue;
            //}
            //
            // FIXME: until backup is fully implemented this causes crashes
            //        on startup with nodes set backup=1. Let them in for now

It looks like "backup" is not supported yet.
@xiaokai-wang do you know the history about this?

@CallMeFoxie

This comment has been minimized.

Copy link
Collaborator

@CallMeFoxie CallMeFoxie commented Oct 22, 2018

I actually do, I commented those lines out :). The main nginx code has/had some code to handle them but it was not implemented in upsync properly and it kept crashing the nginx. The easiest and quickest fix was to comment it out until a proper implementation happens.

@hadret

This comment has been minimized.

Copy link

@hadret hadret commented May 22, 2019

Are there any plans on implementing backup properly/fully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.