-
Notifications
You must be signed in to change notification settings - Fork 387
Haproxy tcp check
Michael Filonenko edited this page Nov 12, 2018
·
1 revision
Ping-based msgpack tcp-check for tarantool
global
defaults
mode tcp
timeout connect 5s
timeout client 5s
timeout server 5s
listen tnt
bind 127.0.0.1:4401
mode tcp
log 127.0.0.1:5050 kern
option tcplog
option log-health-checks
# <--- BEGIN
option tcp-check
tcp-check comment "Waiting for greetings"
tcp-check expect rstring Tarantool
tcp-check send-binary 058200400101
tcp-check comment "Waiting for response"
tcp-check comment "MsgPack Int for packet size"
tcp-check expect binary CE00000018
tcp-check comment "MsgPack Map"
tcp-check expect binary 83
tcp-check comment "MsgPack expect Key 0 (code) is 0"
tcp-check expect binary 00CE00000000
tcp-check comment "MsgPack\ expect\ Key 1 (sync) is 1"
tcp-check expect binary 01CF0000000000000001
# <--- END
server localhost 127.0.0.1:3300 check
server localhost1 127.0.0.1:3301 check
server localhost2 127.0.0.1:3302 check
Lua-eval based msgpack (better if replication)
global
defaults
mode tcp
timeout connect 5s
timeout client 5s
timeout server 5s
listen tnt
bind 127.0.0.1:4401
mode tcp
log 127.0.0.1:5050 kern
option tcplog
option log-health-checks
# <--- BEGIN
tcp-check expect string Tarantool
# Python:
# >>> import msgpack
# >>> header = msgpack.dumps({1: 1, 0: 8})
# >>> body = msgpack.dumps({39: 'local i=box.info() return not i.ro and i.status == "running" and "HAPR" .. "OXYOK"', 33: []})
# >>> length = msgpack.dumps(len(header + body))
# >>> (length + header + body).hex()
tcp-check send-binary 5e820008010182219027da00526c6f63616c20693d626f782e696e666f28292072657475726e206e6f7420692e726f20616e6420692e737461747573203d3d202272756e6e696e672220616e6420224841505222202e2e20224f58594f4b22
tcp-check expect string HAPROXYOK
# <--- END
server localhost 127.0.0.1:3300 check
server localhost1 127.0.0.1:3301 check
server localhost2 127.0.0.1:3302 check
- C coding guidelines ↗
- Lua coding guidelines ↗
- Python coding guidelines ↗
- Maintainer's guide
- Debugging
Architecture
- Server architecture
- R tree index quick start and usage
- LuaJIT
- Vinyl
- Vinyl Architecture
- Vinyl Disk Layout
- Vinyl math
- Vinyl Cookbook
- Bullet1
- SQL
- Appserver modules
- Testing
- Performance
- Privileges and Access control
How To ...?
- ... configure build system
- ... add new fuzzers
- ... build RPM or Deb package using packpack
- ... calculate memory size
- ... debug core dump of stripped tarantool
- ... debug core from different OS
- ... debug fuzzer
- ... generate new bootstrap snapshot
- ... use Address Sanitizer
- ... collect a coredump
- ... generate luacov report for builtin module
- ... verify modified lua files via luacheck
- ... verify Lua files in third_party?
- ... rerun failed jobs
- ... update a third party repository
- Fix wrong decimal indexing after upgrade to 2.10.1
- Caveats when upgrading a cluster on Tarantool 1.6
- Fix illegal field type in a space format when upgrading to 2.10.4
Useful links