Re: Riak Control

2012-09-21 Thread Wes James
Hi,

On Fri, Sep 21, 2012 at 10:47 AM, Pavel Kogan wrote:

> Hi fellows,
>
> I have cluster of 2 physical Riak nodes (I know it is not enough) running
> on CentOS 6.
> Now I am trying to configure Riak control - did everything according to
> instructions:
>
> 1) Enabled HTTPS in app.config
>* {https, [{"0.0.0.0", 8069 }]} *
>

Don't you need to change 0.0.0.0 to your systems IP adddress?



> *
> *
> 2) Generated SSL certificate using this 
> instructions like
> a parrot.
>
> 3) Enabled SSL in app.config
> *   {ssl, [*
> * {certfile, "/etc/riak/server.csr"},*
> * {cacertfile, "/etc/riak/server.crt"},*
> * {keyfile, "/etc/riak/server.key"}*
> *   ]},*
> *
> *
> 4) Enabled riak control in app.config for user guest
>
> 5) Restarted Riak on same node with riak stop + riak start
>
> Trying to browse from my PC 
> https://server_ip:8069/admin 
> without
> any success.
>

With 0.0.0.0 you should try https://127.0.0.1:8069/admin


>
> Does anyone know what/where can be the problem?
>
> Regards,
>Pavel
>
>
>
wes
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Control

2012-09-21 Thread Wes James
If your not directly on the server then you need to change the 0.0.0.0 to
your server actual IP address then put in https://your_ip:8069/admin in
your local browser - of course after restarting riak.

wes

On Fri, Sep 21, 2012 at 10:58 AM, Pavel Kogan wrote:

> Probably I don't get something.
> Address: https://127.0.0.1:8069/admin assuming browsing on localhost.
> However Riak is running on Linux server without Gnome/KDE.
>
> Regards,
> Pavel
>
>
> On Fri, Sep 21, 2012 at 6:54 PM, Wes James  wrote:
>
>> Hi,
>>
>> On Fri, Sep 21, 2012 at 10:47 AM, Pavel Kogan wrote:
>>
>>> Hi fellows,
>>>
>>> I have cluster of 2 physical Riak nodes (I know it is not enough)
>>> running on CentOS 6.
>>> Now I am trying to configure Riak control - did everything according to
>>> instructions:
>>>
>>> 1) Enabled HTTPS in app.config
>>>* {https, [{"0.0.0.0", 8069 }]} *
>>>
>>
>> Don't you need to change 0.0.0.0 to your systems IP adddress?
>>
>>
>>
>>> *
>>> *
>>> 2) Generated SSL certificate using this 
>>> instructions<http://www.akadia.com/services/ssh_test_certificate.html> like
>>> a parrot.
>>>
>>> 3) Enabled SSL in app.config
>>> *   {ssl, [*
>>> * {certfile, "/etc/riak/server.csr"},*
>>> * {cacertfile, "/etc/riak/server.crt"},*
>>> * {keyfile, "/etc/riak/server.key"}*
>>> *   ]},*
>>> *
>>> *
>>> 4) Enabled riak control in app.config for user guest
>>>
>>> 5) Restarted Riak on same node with riak stop + riak start
>>>
>>> Trying to browse from my PC 
>>> https://server_ip:8069/admin<https://iweb59.iweb.cortica.com:8069/admin> 
>>> without
>>> any success.
>>>
>>
>> With 0.0.0.0 you should try https://127.0.0.1:8069/admin
>>
>>
>>>
>>> Does anyone know what/where can be the problem?
>>>
>>> Regards,
>>>Pavel
>>>
>>>
>>>
>> wes
>>
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: cluster capacity planning, 50M of writes per day

2013-03-07 Thread Wes James
You can get crucial m4 512 for $395 on amazon.com.  ocz are $450.

http://www.amazon.com/Crucial-512GB-2-5-Inch-Solid-CT512M4SSD2/dp/B004W2JL3Y

I don't know if you can get these out of the USA or not  (you are out of
USA right?)

wes


On Thu, Mar 7, 2013 at 1:38 PM, Paul Peregud  wrote:

> My first post to the list.
>
> I want to store 20M of bounded FIFO queues (each queue has at most 50
> items, 1KB each). Distribution: 80% of updates at 20% of queues.
>
> Insertion rate: at most 5K per second, random; 50M per day.
> Reading rate: at most 10K per second, each read reads all 50 items.
> Once inserted items are not updated. Oldest at each queue is discarded so
> that queue length <= 50.
>
> How much hardware I might need? From my calculations I need at least 1000
> HDDs assuming that seek time is at 7ms (high end). And that is unreal
> number.
>
> For this type of load (small random reads/writes) SSD seems to be a
> perfect match.
>
> I'm looking at the following configuration:
> 5 of OCZ 512GB Vertex 4 drives at 5 64GB RAM boxes.
> Riak cluster with N=3.
>
> I'm going for cheaper drives because I assume that Riak will allow me to
> replace a node if one of disks suddenly dies.
>
> How crazy is this configuration?
>
> --
> Best regards,
> Paul Peregud
> +48602112091
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: cluster capacity planning, 50M of writes per day

2013-03-07 Thread Wes James
I understand.  I was just suggesting different hardware. That's all.

wes


On Thu, Mar 7, 2013 at 2:20 PM, Paul Peregud  wrote:

> It is not really a question of saving 55$ per disk - I'm wondering if such
> Riak cluster setup is feasible.
>
>
> On Thu, Mar 7, 2013 at 10:14 PM, Wes James  wrote:
>
>> You can get crucial m4 512 for $395 on amazon.com.  ocz are $450.
>>
>>
>> http://www.amazon.com/Crucial-512GB-2-5-Inch-Solid-CT512M4SSD2/dp/B004W2JL3Y
>>
>> I don't know if you can get these out of the USA or not  (you are out of
>> USA right?)
>>
>> wes
>>
>>
>> On Thu, Mar 7, 2013 at 1:38 PM, Paul Peregud wrote:
>>
>>> My first post to the list.
>>>
>>> I want to store 20M of bounded FIFO queues (each queue has at most 50
>>> items, 1KB each). Distribution: 80% of updates at 20% of queues.
>>>
>>> Insertion rate: at most 5K per second, random; 50M per day.
>>> Reading rate: at most 10K per second, each read reads all 50 items.
>>> Once inserted items are not updated. Oldest at each queue is discarded
>>> so that queue length <= 50.
>>>
>>> How much hardware I might need? From my calculations I need at least
>>> 1000 HDDs assuming that seek time is at 7ms (high end). And that is unreal
>>> number.
>>>
>>> For this type of load (small random reads/writes) SSD seems to be a
>>> perfect match.
>>>
>>> I'm looking at the following configuration:
>>> 5 of OCZ 512GB Vertex 4 drives at 5 64GB RAM boxes.
>>> Riak cluster with N=3.
>>>
>>> I'm going for cheaper drives because I assume that Riak will allow me to
>>> replace a node if one of disks suddenly dies.
>>>
>>> How crazy is this configuration?
>>>
>>> --
>>> Best regards,
>>> Paul Peregud
>>> +48602112091
>>>
>>> ___
>>> riak-users mailing list
>>> riak-users@lists.basho.com
>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>
>>>
>>
>
>
> --
> Best regards,
> Paul Peregud
> +48602112091
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


help with riak search

2012-04-02 Thread Wes James
Is there documentation to indicate what riak search supports in search
operations.

I have been testing some searches and even looked at:

http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html

for some ideas.

These work:

search:search_doc(<<"searchable-dbooks">>,<<"notes:Water">>).
search:search_doc(<<"searchable-dbooks">>,<<"notes:water">>).
search:search_doc(<<"searchable-dbooks">>,<<"notes:water OR notes:Water">>).

But these don't

? seems to work at the end but not in  the middle.  Same with *.   Why?

search:search_doc(<<"searchable-dbooks">>,<<"notes:Wate?">>) works.

But not

search:search_doc(<<"searchable-dbooks">>,<<"notes:Wa?er">>).


How would you search for "&"?  maybe it is too short to be searched on

search:search_doc(<<"searchable-dbooks">>,<<"notes:&">>).  In order to
index "&", I had to use "&":

Category: Water & Wetlands (W).

When an xml file is indexed, say:



0
Ekologie lučních porostů (A)
Rychnovská, Milena, Emilie
Balátová-Tuláčková, Blanka Úlehlová, Jaroslav Pelikán
1985
Academia
amazon 5/22/09 Category: Ecology (Y)
8.00
10.00

>,<<"id:0">>).
{0,"0.0",[]}

Thanks,

Wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: help with riak search

2012-04-02 Thread Wes James
On Mon, Apr 2, 2012 at 1:45 PM, Daniel Reverri  wrote:




>
> I was able to search for "&" by escaping the character:
> search-cmd search wildcards "value:\&"
>

with the erlang command, I get an error:

(riak@127.0.0.1)25>
search:search_doc(<<"searchable-dbooks">>,<<"notes:\&">>).
** exception error: no match of right hand side value
{error,{lucene_parse,"syntax error before: \"&\""}}
 in function  riak_search_client:parse_query/3
 in call from search:search_doc/3

or even with no escape for &:

(riak@127.0.0.1)26> search:search_doc(<<"searchable-dbooks">>,<<"notes:&">>).
** exception error: no match of right hand side value
{error,{lucene_parse,"syntax error before: \"&\""}}
 in function  riak_search_client:parse_query/3
 in call from search:search_doc/3



Thanks,

-wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: help with riak search

2012-04-02 Thread Wes James
Ah, OK - thanks!  Yes - that worked

-wes


On Mon, Apr 2, 2012 at 2:35 PM, Daniel Reverri  wrote:
> From the Erlang console you have escape twice (not sure why):
> search:search_doc(<<"searchable-dbooks">>, <<"notes:\\&">>).
>
> Thanks,
> Dan
>
> --
> Daniel Reverri
> Developer Advocate
> Basho Technologies, Inc.
> d...@basho.com
>
>
> On Monday, April 2, 2012 at 1:29 PM, Wes James wrote:
>
>> On Mon, Apr 2, 2012 at 1:45 PM, Daniel Reverri > (mailto:d...@basho.com)> wrote:
>>
>> 
>>
>>
>> >
>> > I was able to search for "&" by escaping the character:
>> > search-cmd search wildcards "value:\&"
>>
>>
>>
>> with the erlang command, I get an error:
>>
>> (riak@127.0.0.1 (mailto:riak@127.0.0.1))25>
>> search:search_doc(<<"searchable-dbooks">>,<<"notes:\&">>).
>> ** exception error: no match of right hand side value
>> {error,{lucene_parse,"syntax error before: \"&\""}}
>> in function riak_search_client:parse_query/3
>> in call from search:search_doc/3
>>
>> or even with no escape for &:
>>
>> (riak@127.0.0.1 (mailto:riak@127.0.0.1))26> 
>> search:search_doc(<<"searchable-dbooks">>,<<"notes:&">>).
>> ** exception error: no match of right hand side value
>> {error,{lucene_parse,"syntax error before: \"&\""}}
>> in function riak_search_client:parse_query/3
>> in call from search:search_doc/3
>>
>> 
>>
>> Thanks,
>>
>> -wes
>
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


works on cli but not in erl vm

2012-04-03 Thread Wes James
I can get results with:

bin/search-cmd search mybucket "field:some-text"

but if I run erl like this:

erl -name riaktest@127.0.0.1 -setcookie riak -pa lib/*/ebin

then run:

search:search_doc(<<"mybucket">>,<<"field:some-text">>).

I get the error:

** exception error: bad argument
 in function  ets:lookup/2
called as ets:lookup(schema_table,<<"mybucket">>)
 in call from riak_search_config:get_schema/1
 in call from riak_search_client:parse_query/3
 in call from search:search_doc/3

Any idea why?

Thanks,

Wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: works on cli but not in erl vm

2012-04-03 Thread Wes James
Ok.  When I bin/riak attach and run the search:search_doc it works.
How to I do a search as a "client" or outside the riak app?

Thanks,

Wes

On Tue, Apr 3, 2012 at 3:55 PM, Wes James  wrote:
> I can get results with:
>
> bin/search-cmd search mybucket "field:some-text"
>
> but if I run erl like this:
>
> erl -name riaktest@127.0.0.1 -setcookie riak -pa lib/*/ebin
>
> then run:
>
> search:search_doc(<<"mybucket">>,<<"field:some-text">>).
>
> I get the error:
>
> ** exception error: bad argument
>     in function  ets:lookup/2
>        called as ets:lookup(schema_table,<<"mybucket">>)
>     in call from riak_search_config:get_schema/1
>     in call from riak_search_client:parse_query/3
>     in call from search:search_doc/3
>
> Any idea why?
>
> Thanks,
>
> Wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


building app using reak

2012-04-03 Thread Wes James
It looks like search:search_doc is using riak:local_client, so it
seems that if riak is to be used with an erlang app that uses
search:search_doc then the erlang app would need to start in the same
erl vm as when riak starts.  If not, how?

Thanks,

Wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


make rel question

2012-04-05 Thread Wes James
When make rel is run, where is the information about how to decide
what to copy in to rel/riak/lib?

Thanks,

Wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: make rel question

2012-04-05 Thread Wes James
Jared,

Thanks!  I'll take a look at that.

-wes

On Thu, Apr 5, 2012 at 11:50 AM, Jared Morrow  wrote:
> Wes,
>
> That information is in the '/rel' directory in the top-level riak repo
> (https://github.com/basho/riak/tree/master/rel) with most of it being in the
> reltool.config file.   The magic of what gets included is sometimes
> explicitly from that reltool.config file, and some of it are dependencies
> that reltool (http://www.erlang.org/doc/apps/reltool/users_guide.html)
> figures out on its own.   Specifically in riak's case, reltool is called via
> `rebar generate` which does some additional work for reltool before it is
> called.
>
> If you want to see the real grit in how rebar calls reltool look
> here: https://github.com/basho/rebar/blob/master/src/rebar_reltool.erl
>
> Good luck!
> -Jared
>
>
>
>
> On Apr 5, 2012, at 11:17 AM, Wes James wrote:
>
> When make rel is run, where is the information about how to decide
> what to copy in to rel/riak/lib?
>
> Thanks,
>
> Wes
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


rebar/reltool cool!

2012-04-05 Thread Wes James
Wow.  These tools are very helpful!  I was messing with make rel and
was trying to work with cowboy and riak together.  So I was starting
riak then starting cowboy inside of riak so cowboy could talk to riak
with search:searchdoc.  With the previous help here, I now have cowboy
as part of the release and when I do riak start, cowboy starts.

awesome!

Anyway,  how do you make changes, i.e., I make changes to a cowboy
default_handler.erl and then I have to stop riak, remove the old riak
folder, do make rel again, add my test data, then riak start to test
the changes.  Is there a different work flow in doing this? I could
just edit the default_handler and copy the beam to the
rel/riak/lib/... folder.

Thanks!

-wes

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


appearance of text different in riak different than original xml data

2012-04-06 Thread Wes James
I imported many records, one of which looks like this:



0
Ekologie lučních porostů (A)
Rychnovská, Milena, Emilie Balátová-Tuláčková,
Blanka Úlehlová, Jaroslav Pelikán
1985
Academia
-
amazon 5/22/09 Category: Ecology (Y)
8.00
10.00



with

bin/search-cmd solr books books.xml

Notice the characters above.  In the riak -> cowboy -> webpage it looks
like:

Id:0Title:title: Ekologie lučních porostů (A)Auther Editor:author_editor:
Rychnovská, Milena, Emilie Balátová-Tuláčková, Blanka Úlehlová,
Jaroslav PelikánDate of Publication:date_of_publication: 1985Notes:publisher:
AcademiaNotes:notes: amazon 5/22/09 Category: Ecology (Y)Purchase
Price:purchase_price:
10.00Valuation:valuation: 8.00
Is there a way I can fix this?

Doing an io:format it it looks like:

Rychnovská, Milena, Emilie Balátová-Tuláčková, Blanka Úlehlová,
Jaroslav Pelikán

Thanks,

Wes
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: appearance of text different in riak different than original xml data

2012-04-07 Thread Wes James
I found it. I thought if any web site might be able to handle unicode,
it would be erlang.org, so I went and grabbed some of the header text:


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>


test
  


and it works correctly now.

thanks

On Fri, Apr 6, 2012 at 3:18 PM, Kresten Krab Thorup  wrote:
> It looks like you may have missed specifying the charset when importing your 
> data; could that be the case?
>
> You need to specify the charset when importing 8-bit text.  It looks like 
> your xml is utf-8 encoded, so it should be imported using something like this:
>
> curl -H 'Content-Type: text/html;charset=UTF-8' -X PUT @datafile.xml 
> http://host:port/riak/bucket/key
>
> The various language clients have different ways of specifying the charset 
> for a value; so if you imported the xml using some other method you need to 
> find out where to specify it.
>
> Perhaps to verify, you can check the result of a curl -v (verbose, print the 
> headers) for one of your values.  If it does not come back with a charset=XXX 
> in the Content-Type header, then this is your problem.
>
> Kresten
>
>
>
> On Apr 6, 2012, at 4:44 PM, Wes James wrote:
>
> I imported many records, one of which looks like this:
>
> 
> 
> 0
> Ekologie lučních porostů (A)
> Rychnovská, Milena, Emilie Balátová-Tuláčková, 
> Blanka Úlehlová, Jaroslav Pelikán
> 1985
> Academia
> -
> amazon 5/22/09 Category: Ecology (Y)
> 8.00
> 10.00
> 
> 
>
> with
>
> bin/search-cmd solr books books.xml
>
> Notice the characters above.  In the riak -> cowboy -> webpage it looks like:
>
> Id:     0
> Title:  title: Ekologie luÄ ních porostů (A)
> Auther Editor:  author_editor: Rychnovská, Milena, Emilie Balátová-TulÃ¡Ä 
> ková, Blanka Úlehlová, Jaroslav Pelikán
> Date of Publication:    date_of_publication: 1985
> Notes:  publisher: Academia
> Notes:  notes: amazon 5/22/09 Category: Ecology (Y)
> Purchase Price: purchase_price: 10.00
> Valuation:      valuation: 8.00
>
> Is there a way I can fix this?
>
> Doing an io:format it it looks like:
>
> Rychnovská, Milena, Emilie Balátová-TulÃ¡Ä ková, Blanka Úlehlová, 
> Jaroslav Pelikán
>
> Thanks,
>
> Wes
> ___
> riak-users mailing list
> riak-users@lists.basho.com<mailto:riak-users@lists.basho.com>
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
>
> Mobile: + 45 2343 4626 | Skype: krestenkrabthorup | Twitter: @drkrab
> Trifork A/S  |  Margrethepladsen 4  | DK- 8000 Aarhus C |  Phone : +45 8732 
> 8787  |  www.trifork.com<http://www.trifork.com>
>
>
>
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: appearance of text different in riak different than original xml data

2012-04-07 Thread Wes James
Ok - that's good to know.

Thanks,

Wes

On Sat, Apr 7, 2012 at 9:32 AM, Sean Cribbs  wrote:
> Wes,
>
> Also, if you're using curl to load things into Riak, be sure to use
> --data-binary with your payload, which will not try to convert multibyte
> characters or line-terminators.
>
> On Sat, Apr 7, 2012 at 11:21 AM, Wes James  wrote:
>>
>> I found it. I thought if any web site might be able to handle unicode,
>> it would be erlang.org, so I went and grabbed some of the header text:
>>
>> 
>> >    'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
>> 
>> 
>> test
>>  
>> 
>>
>> and it works correctly now.
>>
>> thanks
>>
>> On Fri, Apr 6, 2012 at 3:18 PM, Kresten Krab Thorup 
>> wrote:
>> > It looks like you may have missed specifying the charset when importing
>> > your data; could that be the case?
>> >
>> > You need to specify the charset when importing 8-bit text.  It looks
>> > like your xml is utf-8 encoded, so it should be imported using something
>> > like this:
>> >
>> > curl -H 'Content-Type: text/html;charset=UTF-8' -X PUT @datafile.xml
>> > http://host:port/riak/bucket/key
>> >
>> > The various language clients have different ways of specifying the
>> > charset for a value; so if you imported the xml using some other method you
>> > need to find out where to specify it.
>> >
>> > Perhaps to verify, you can check the result of a curl -v (verbose, print
>> > the headers) for one of your values.  If it does not come back with a
>> > charset=XXX in the Content-Type header, then this is your problem.
>> >
>> > Kresten
>> >
>> >
>> >
>> > On Apr 6, 2012, at 4:44 PM, Wes James wrote:
>> >
>> > I imported many records, one of which looks like this:
>> >
>> > 
>> > 
>> > 0
>> > Ekologie lučních porostů (A)
>> > Rychnovská, Milena, Emilie
>> > Balátová-Tuláčková, Blanka Úlehlová, Jaroslav Pelikán
>> > 1985
>> > Academia
>> > -
>> > amazon 5/22/09 Category: Ecology (Y)
>> > 8.00
>> > 10.00
>> > 
>> > 
>> >
>> > with
>> >
>> > bin/search-cmd solr books books.xml
>> >
>> > Notice the characters above.  In the riak -> cowboy -> webpage it looks
>> > like:
>> >
>> > Id:     0
>> > Title:  title: Ekologie luÄ ních porostů (A)
>> > Auther Editor:  author_editor: Rychnovská, Milena, Emilie
>> > Balátová-TulÃ¡Ä ková, Blanka Úlehlová, Jaroslav Pelikán
>> > Date of Publication:    date_of_publication: 1985
>> > Notes:  publisher: Academia
>> > Notes:  notes: amazon 5/22/09 Category: Ecology (Y)
>> > Purchase Price: purchase_price: 10.00
>> > Valuation:      valuation: 8.00
>> >
>> > Is there a way I can fix this?
>> >
>> > Doing an io:format it it looks like:
>> >
>> > Rychnovská, Milena, Emilie Balátová-TulÃ¡Ä ková, Blanka Úlehlová,
>> > Jaroslav Pelikán
>> >
>> > Thanks,
>> >
>> > Wes
>> > ___
>> > riak-users mailing list
>> > riak-users@lists.basho.com<mailto:riak-users@lists.basho.com>
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> >
>> >
>> >
>> > Mobile: + 45 2343 4626 | Skype: krestenkrabthorup | Twitter: @drkrab
>> > Trifork A/S  |  Margrethepladsen 4  | DK- 8000 Aarhus C |  Phone : +45
>> > 8732 8787  |  www.trifork.com<http://www.trifork.com>
>> >
>> >
>> >
>> >
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: riak erlang doubt

2012-04-20 Thread Wes James
Probably you want

#!/usr/local/bin/escript

or

#!/usr/bin/env escript

at the top.

Wes

On Tue, Apr 17, 2012 at 2:15 AM, wrote:

>  Dear Team,
>
> ** **
>
> Please do me the needful In resolving the same ..
>
> ** **
>
> I have installed erlang and riak cluster seprrately its working
> fineran some sample program on erlang it was running fine ...now i am
> trying to run erlang script to load teh data onto riak DB using
> load_data.erl and goog.csv
>
> 1 #!/usr/local/bin escript
>
>   2 %% -*- erlang -*-
>
>   3 main([Filename]) ->
>
>   4 {ok, Data} = file:read_file(Filename),
>
>   5 Lines = tl(re:split(Data, "\r?\n", [{return, binary},trim])),
>
>   6 lists:foreach(fun(L) -> LS = re:split(L, ","), format_and_inser
> t(LS) end, Lines).
>
>   7
>
>   8 format_and_insert(Line) ->
>
>   9 JSON = io_lib:format("{\"Date\":\"~s\",\"Open\":~s,\"High\":~s,
> \"Low\":~s,\"Close\":~s,\"Volume\":~s,\"Adj. Close\":~s}", Line),
>
> 10 Command = io_lib:format("curl -X PUT http://127.0.0.1:8098/riak
> /goog/~s -d '~s' -H 'content-type: application/json'", [hd(Line),JSON]),
> 
>
> 11 io:format("Inserting: ~s~n", [hd(Line)]),
>
> 12 os:cmd(Command).
>
> this is my load_data.erl...i have placed goog.csv and load_data.erl onto
> /home/hadoop/erlangdwnloadamazon/otp_src_R14B03/bin ...and trying to run
> the same on erl shell,c(load_data).on erlang shell ..struck up with teh
> following error
>
> ** **
>
> Eshell V5.8.4  (abort with ^G)
>
> 1> c(load_data).
>
> ./load_data.erl:1: syntax error before: '#'
>
> ./load_data.erl:8: no module definition
>
> ./load_data.erl:8: Warning: function format_and_insert/1 is unused
>
> error
>
> 2> halt().
>
> ** **
>
> ** **
>
> ** **
>
> Thanks & regards
>
> sangeetha
>
> ** **
>
> This e-mail and any files transmitted with it are for the sole use of the 
> intended recipient(s) and may contain confidential and privileged 
> information. If you are not the intended recipient(s), please reply to the 
> sender and destroy all copies of the original message. Any unauthorized 
> review, use, disclosure, dissemination, forwarding, printing or copying of 
> this email, and/or any action taken in reliance on the contents of this 
> e-mail is strictly prohibited and may be unlawful.
>
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com