I am a Riak newbie. I installed Riak 2.1.1 from the source on my local machine while following instructions at: https://docs.basho.com/riak/latest/ops/building/installing/mac-osx/
I then started three nodes and pinged all the three nodes and received 'pong' as the response.
I joined then joined the three nodes to create a cluster. Checking the cluster member status:
dev1/bin/riak-admin member-status
================================= Membership ==================================
Status Ring Pending Node
-------------------------------------------------------------------------------
valid 34.4% -- '[email protected]'
valid 32.8% -- '[email protected]'
valid 32.8% -- '[email protected]'
-------------------------------------------------------------------------------
Valid:3 / Leaving:0 / Exiting:0 / Joining:0 / Down:0
I looked at the riak.config file in rel/riak/etc/ directory and saw that the following has been set:
## listener.http.<name> is an IP address and TCP port that the Riak
## HTTP interface will bind.
##
## Default: 127.0.0.1:8098
##
## Acceptable values:
## - an IP/port pair, e.g. 127.0.0.1:10011
listener.http.internal = 127.0.0.1:8098
## listener.protobuf.<name> is an IP address and TCP port that the Riak
## Protocol Buffers interface will bind.
##
## Default: 127.0.0.1:8087
##
## Acceptable values:
## - an IP/port pair, e.g. 127.0.0.1:10011
listener.protobuf.internal = 127.0.0.1:8087
I then installed the Riak python client using pip. I am following the Riak python client docs at http://riak-python-client.readthedocs.org/en/2.1.0/client.html.
The following is my Python script:
import riak
client = riak.RiakClient(pb_port=8087,protocol='pbc')
print 'finished'
user_bucket = client.bucket('user')
val1 = 1
key1 = user_bucket.new('one', data=val1)
key1.store()
print 'finished2'
However, running the python script gives the following error:
/Library/Python/2.7/site-packages/riak/security.py:35: UserWarning: Found OpenSSL 0.9.8zd 8 Jan 2015 version, but expected at least OpenSSL 1.0.1g. Security may not support TLS 1.2.
warnings.warn(msg, UserWarning)
finished
Traceback (most recent call last):
File "/Users/me/Documents/project/RiakDataLoader/src/DataLoader.py", line 11, in <module>
**key1.store()**
File "/Library/Python/2.7/site-packages/riak/riak_object.py", line 286, in store
timeout=timeout)
File "/Library/Python/2.7/site-packages/riak/client/transport.py", line 196, in wrapper
return self._with_retries(pool, thunk)
File "/Library/Python/2.7/site-packages/riak/client/transport.py", line 151, in _with_retries
raise e.args[0]
socket.error: [Errno 61] Connection refused
All my nodes were running before I ran the python script.
I then tried the following command on the terminal using the http port:
$ curl -XPUT http://127.0.0.1:8098/buckets/welcome/keys/german -H 'Content-Type: text/plain' -d 'herzlich willkommen'
curl: (7) Failed to connect to 127.0.0.1 port 8098: Connection refused
What may be the cause of this connection refused error? Have been chasing this problem for hours. Any help would be greatly appreciated!
Since you are using several dev nodes the config files will be under the
dev
directory, such asdev/dev1/etc/riak.conf
. You'll need to check there to see which ports are being used for the protocol buffers listener for each node.. The configuration under therel
directory is only suitable for running a single node on the machine.