Last active
November 23, 2016 17:44
-
-
Save lukebakken/81c0609c274b083272f182443a6267f5 to your computer and use it in GitHub Desktop.
Riak / haproxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log /dev/log local0 info | |
pidfile /home/lbakken/run/haproxy.pid | |
defaults | |
log global | |
timeout connect 1s | |
timeout client 50ms | |
timeout server 1s | |
backend riak_rest_backend | |
mode http | |
option httplog | |
server riak1 ipv4@localhost:10018 | |
frontend riak_rest | |
bind ipv4@localhost:8098 | |
mode http | |
option contstats | |
default_backend riak_rest_backend | |
backend riak_protocol_buffer_backend | |
mode tcp | |
option tcpka | |
option srvtcpka | |
server riak1 ipv4@localhost:10017 | |
frontend riak_protocol_buffer | |
bind ipv4@localhost:8087 | |
mode tcp | |
option tcplog | |
option contstats | |
mode tcp | |
option tcpka | |
default_backend riak_protocol_buffer_backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import riak,time | |
bn = 'riak-haproxy' | |
kn = 'riak-haproxy' | |
riak.RiakClient.retries = 1 | |
c = riak.RiakClient() | |
# b = c.bucket(bn) | |
# b.new(kn, data={"foo": "one", "bar": "baz"}).store() | |
items = [] | |
i = 0 | |
while i < 3: | |
print(c.ping()) | |
# for itm in c.stream_buckets(): | |
# for itm in c.stream_keys(b): | |
# items.extend(itm) | |
# print('ITEMS:\n') | |
# print(items) | |
# print('\n') | |
time.sleep(1) | |
i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment