小编And*_*rez的帖子

haproxy/docker未找到启用的侦听器(检查'bind'指令)!退出

我试图用docker运行haproxy.我按照这里的说明操作:

https://hub.docker.com/_/haproxy/

我能够构建docker镜像但是在尝试运行它之后.

运用

docker run -d --link another_container:another_container --name mc-ha -v haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro my_own_haproxy:latest
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

[ALERT] 298/054910 (1) : [haproxy.main()] No enabled listener found (check for 'bind' directives) ! Exiting.
Run Code Online (Sandbox Code Playgroud)

我搜索了它,但我发现的唯一的东西是ha代理的源代码.

这是我的haproxy.cfg

global
    log /dev/log    local0
    log /dev/log    local1 notice
    chroot /var/lib/haproxy
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

    # Default SSL material locations
    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private

    # Default ciphers to use on SSL-enabled listening sockets.
    # For more information, see …
Run Code Online (Sandbox Code Playgroud)

proxy high-availability haproxy docker

6
推荐指数
1
解决办法
3060
查看次数

iOS我可以将所有委托方法放在另一个类上.将委托继承到视图控制器中

我想要的是将我的所有委托方法集中到一个类中.我可以使用其默认值或覆盖委托方法.

例如:

ViewController.m

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>

@end
Run Code Online (Sandbox Code Playgroud)

ViewController.h

#import "ViewController.h"
#import "TableDelegateContainers.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
Run Code Online (Sandbox Code Playgroud)

TableDelegateContainers.h

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return sample.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    return cell;
}
Run Code Online (Sandbox Code Playgroud)

基本上UITableViewDataSource需要的所有委托方法都将被放到另一个类中.当我将该类导入到ViewController.h时,将使用这些方法.如果我愿意,我可以覆盖它们.

这可以通过课堂实现吗?还是需要其他实体?

iphone delegates class objective-c ios

2
推荐指数
1
解决办法
3821
查看次数