Skip to content

Cluster example out of date #111

@candlerb

Description

@candlerb

The cluster example uses command line flags which are no longer valid:

  • Error: unknown flag: --debug
  • Error: unknown flag: --log-dir (should be --data-dir ?)
  • Error: unknown flag: --prometheus-addr
  • Error: unknown flag: --serf-members (should be --join or --join-wan ?)

So I tried running it like this:

./jocko broker --data-dir=/tmp/jocko0 --broker-addr=127.0.0.1:9001 --raft-addr=127.0.0.1:9002 --serf-addr=127.0.0.1:9003 --id=1 >broker0.out 2>&1 &
./jocko broker --data-dir=/tmp/jocko1 --broker-addr=127.0.0.1:9101 --raft-addr=127.0.0.1:9102 --serf-addr=127.0.0.1:9103 --join=127.0.0.1:9003 --id=2 >broker1.out 2>&1 &
./jocko broker --data-dir=/tmp/jocko2 --broker-addr=127.0.0.1:9201 --raft-addr=127.0.0.1:9202 --serf-addr=127.0.0.1:9203 --join=127.0.0.1:9003 --id=3 >broker2.out 2>&1 &

These options are accepted; but no broker is listening on ports 9001, 9101 or 9201, nor is serf listening on 9003, 9103 or 9203.

# netstat -natp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:9002          0.0.0.0:*               LISTEN      1413/jocko
tcp        0      0 127.0.0.1:9102          0.0.0.0:*               LISTEN      1422/jocko
tcp        0      0 127.0.0.1:9202          0.0.0.0:*               LISTEN      1430/jocko
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      436/sshd
tcp6       0      0 :::8301                 :::*                    LISTEN      1413/jocko
tcp6       0      0 :::36275                :::*                    LISTEN      1413/jocko
tcp6       0      0 :::22                   :::*                    LISTEN      436/sshd
# netstat -naup
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 127.0.0.1:51041         127.0.0.1:6831          ESTABLISHED 1413/jocko
udp        0      0 0.0.0.0:68              0.0.0.0:*                           250/dhclient
udp        0      0 127.0.0.1:41643         127.0.0.1:6831          ESTABLISHED 1430/jocko
udp        0      0 127.0.0.1:43866         127.0.0.1:6831          ESTABLISHED 1422/jocko
udp6       0      0 :::8301                 :::*                                1413/jocko

Captured output:

==> broker0.out <==
2018/04/03 20:58:05 Initializing logging reporter
2018-04-03T20:58:05.431Z	INFO	jocko/broker.go:107	hello	{"id": 1, "broker addr": "", "serf addr": "127.0.0.1:9003", "raft addr": "127.0.0.1:9002", "id": 0, "raft addr": "127.0.0.1:9002"}
2018/04/03 20:58:05 [INFO] raft: Initial configuration (index=0): []
2018/04/03 20:58:05 [INFO] raft: Node at 127.0.0.1:9002 [Follower] entering Follower state (Leader: "")
2018/04/03 20:58:05 [INFO] serf: EventMemberJoin: builder ::
2018/04/03 20:58:05 [WARN] serf: Failed to re-join any previously known node
2018-04-03T20:58:05.528Z	INFO	jocko/serf.go:66	adding LAN server	{"id": 1, "broker addr": "", "serf addr": "127.0.0.1:9003", "raft addr": "127.0.0.1:9002", "id": 0, "raft addr": "127.0.0.1:9002", "meta": {"ID":0,"Name":"","Bootstrap":false,"Expect":0,"NonVoter":false,"Status":1,"RaftAddr":"127.0.0.1:9002","SerfLANAddr":"%!b(string=127.0.0.1:9003):8301","BrokerAddr":"127.0.0.1:9001"}}
2018-04-03T20:58:05.529Z	INFO	jocko/server.go:71	hello	{"id": 1, "broker addr": "", "serf addr": "127.0.0.1:9003", "raft addr": "127.0.0.1:9002", "node id": 0, "addr": "127.0.0.1:9001"}
2018/04/03 20:58:06 [WARN] raft: no known peers, aborting election

==> broker1.out <==
2018/04/03 20:58:43 Initializing logging reporter
2018-04-03T20:58:43.325Z	INFO	jocko/broker.go:107	hello	{"id": 2, "broker addr": "", "serf addr": "127.0.0.1:9103", "raft addr": "127.0.0.1:9102", "id": 0, "raft addr": "127.0.0.1:9102"}

==> broker2.out <==
2018/04/03 20:59:13 Initializing logging reporter
2018-04-03T20:59:13.172Z	INFO	jocko/broker.go:107	hello	{"id": 3, "broker addr": "", "serf addr": "127.0.0.1:9203", "raft addr": "127.0.0.1:9202", "id": 0, "raft addr": "127.0.0.1:9202"}

I tried running the first process under strace. Here are all the lines matching htons:

connect(4, {sa_family=AF_INET, sin_port=htons(6831), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
getsockname(4, {sa_family=AF_INET, sin_port=htons(59060), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
getpeername(4, {sa_family=AF_INET, sin_port=htons(6831), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
bind(6, {sa_family=AF_INET, sin_port=htons(9002), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
getsockname(6, {sa_family=AF_INET, sin_port=htons(9002), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
bind(10, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
bind(11, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
bind(10, {sa_family=AF_INET6, sin6_port=htons(8301), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
getsockname(10, {sa_family=AF_INET6, sin6_port=htons(8301), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
bind(11, {sa_family=AF_INET6, sin6_port=htons(8301), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
getsockname(11, {sa_family=AF_INET6, sin6_port=htons(8301), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
bind(12, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
getsockname(12, {sa_family=AF_INET6, sin6_port=htons(45202), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0

(I don't see any attempt to open ports 9001 or 9003?)

Here are the lines matching = -1:

access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
epoll_ctl(5, EPOLL_CTL_ADD, 4, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188013312, u64=140576467611392}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc420055a8c) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_ADD, 4, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188013312, u64=140576467611392}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc42005599c) = -1 EPERM (Operation not permitted)
newfstatat(AT_FDCWD, "/etc/mdns.allow", 0xc4200209f8, 0) = -1 ENOENT (No such file or directory)
epoll_ctl(5, EPOLL_CTL_ADD, 4, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188013312, u64=140576467611392}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc420055654) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188012896, u64=140576467610976}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 8, 0xc42019b0a4) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188012896, u64=140576467610976}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 9, 0xc42019afec) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188012896, u64=140576467610976}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 9, 0xc42019abb4) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2188012896, u64=140576467610976}}) = -1 EPERM (Operation not permitted)
epoll_ctl(5, EPOLL_CTL_DEL, 9, 0xc42019afe4) = -1 EPERM (Operation not permitted)

The EPERM issues are a bit worrying. Maybe this is a symptom of running within an lxd container (but then again, running in a docker container is supposed to work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions