Initializing a commit hook

Mav erick mav4001 at gmail.com
Fri Nov 18 18:03:43 EST 2016


Here you go ...

For the second url - I think you meant testbucket without the hyphen, Also
I think you have an extra "props" in there





* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8098 (#0)
> GET /types/maps/props HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8098
> Accept: */*
>
< HTTP/1.1 200 OK
< Vary: Accept-Encoding
* Server MochiWeb/1.1 WebMachine/1.10.6 (no drinks) is not blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.6 (no drinks)
< Date: Fri, 18 Nov 2016 22:27:56 GMT
< Content-Type: application/json
< Content-Length: 545
<
* Connection #0 to host localhost left intact
{"props":{"active":true,"allow_mult":true,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod"
:"riak_core_util","fun":"chash_std_keyfun"},"claimant":"riak at 10.243.44.165
","datatype":"map","dvv_en
abled":true,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"m
apreduce_linkfun"},"n_val":3,"notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit
":[{"mod":"commit_hooks","fun":"precommit_hook"
}],"pw":0,"r":"quorum","rw":"quorum","smal
l_vclock":50,"w":"quorum","young_vclock":20}}


and ...

$ curl -4vvv localhost:8098/types/maps/props/buckets/testbucket/props
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8098 (#0)
> GET /types/maps/props/buckets/testbucket/props HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8098
> Accept: */*
>
< HTTP/1.1 404 Object Not Found
* Server MochiWeb/1.1 WebMachine/1.10.6 (no drinks) is not blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.6 (no drinks)
< Date: Fri, 18 Nov 2016 22:57:51 GMT
< Content-Type: text/html
< Content-Length: 193
<
* Connection #0 to host localhost left intact
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The
requested document was no
t found on this server.<P><HR><ADDRESS>mochiweb+webmachine web
server</ADDRESS></BODY></HTML>$


with the corrected url
$ curl -4vvv localhost:8098/types/maps/buckets/testbucket/props
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8098 (#0)
> GET /types/maps//buckets/testbucket/props HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8098
> Accept: */*
>
< HTTP/1.1 200 OK
< Vary: Accept-Encoding
* Server MochiWeb/1.1 WebMachine/1.10.6 (no drinks) is not blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.6 (no drinks)
< Date: Fri, 18 Nov 2016 22:59:22 GMT
< Content-Type: application/json
< Content-Length: 565
<
* Connection #0 to host localhost left intact
{"props":{"name":"testbucket","active":true,"allow_mult":true,"basic_quorum":false,"big_vclock":
chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"claimant":"
riak at 10.243.44.165",
atype":"map","dvv_enabled":true,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_
ink_walker","fun":"mapreduce_linkfun"},"n_val":3,"notfound_ok":true,"old_vclock":86400,"postcomm
[],"pr":0,"precommit":[{"mod":"commit_hooks","fun":"precommit_hook"}
],"pw":0,"r":"quo
,"rw":"quorum","small_vclock":50,"w":"quorum","young_vclock":20}}$





On 18 November 2016 at 17:23, Luke Bakken <lbakken at basho.com> wrote:

> What is the output of these commands?
>
> curl -4vvv localhost:8098/types/maps/props
>
> curl -4vvv localhost:8098/types/maps/props/buckets/test-bucket/props
>
> On Fri, Nov 18, 2016 at 2:21 PM, Mav erick <mav4001 at gmail.com> wrote:
> > Luke
> >
> > I was able to change the properties with your URL, but still the hooks
> are
> > not being called for typed buckets ONLY.
> >
> > The hook is being called for all buckets with no type. So I am sure that
> > riak can find the beam file on all my nodes.
> >
> > I tried restarting riak on all nodes. Still same problem. The hook is
> called
> > for buckets without a type, but wont be called for buckets with a type
> >
> >
> > On 18 November 2016 at 16:45, Luke Bakken <lbakken at basho.com> wrote:
> >>
> >> Mav -
> >>
> >> You're not using the correct HTTP URL. You can use this command:
> >>
> >>
> >> http://docs.basho.com/riak/kv/2.1.4/using/reference/bucket-
> types/#updating-a-bucket-type
> >>
> >> Or this URL:
> >>
> >> curl -XPUT localhost:8098/types/maps/props -H 'Content-Type:
> >> application/json' -d
> >> '{"props":{"precommit":[{"mod":"myhooks","fun":"precommit_hook"}]}}'
> >>
> >> Please ensure that the "myhooks" beam file is on all Riak servers in a
> >> directory that will be picked up by Riak when it starts:
> >>
> >> http://docs.basho.com/riak/kv/2.1.4/using/reference/custom-code/
> >>
> >> --
> >> Luke Bakken
> >> Engineer
> >> lbakken at basho.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20161118/b7b98820/attachment-0002.html>


More information about the riak-users mailing list