On May 6, 2014, at 8:19 PM, Thomas Lumley wrote:
> The error message looks as if you need /bin on the end of the path:
> it's looking for /usr/local/monetdb/mserver5 but the file is probably
> /usr/local/monetdb/bin/mserver5
>
> Personally, I start the server from the Terminal command line, per
> http://www.monetdb.com/Documentation/monetdbd
>
> First time only
> /usr/local/monetdb/bin/monetdbd create ~/my-dbfarm
>
> Subsequent times:
> Before starting R
> /usr/local/monetdb/bin/monetdbd start ~/my-dbfarm
Both of those commands run without error from the Terminal.app command line.
When I execute one of the suggested commands in the Documentation page, I get:
david-winsemiuss-mac-pro:~ davidwinsemius$ monetdbd get all ~/my-dbfarm
-bash: monetdbd: command not found
But if I give it a full path it succeeds:
david-winsemiuss-mac-pro:~ davidwinsemius$ /usr/local/monetdb/bin/monetdbd get
all ~/my-dbfarm
property value
hostname david-winsemiuss-mac-pro.local
dbfarm /Users/davidwinsemius/my-dbfarm
status monetdbd[22794] 1.7 (Jan2014-SP1) is serving this dbfarm
mserver /usr/local/monetdb/bin/mserver5
logfile /Users/davidwinsemius/my-dbfarm/merovingian.log
pidfile /Users/davidwinsemius/my-dbfarm/merovingian.pid
sockdir /tmp
port 50000
exittimeout 60
forward proxy
discovery true
discoveryttl 600
control no
passphrase <unknown>
mapisock /tmp/.s.monetdb.50000
controlsock /tmp/.s.merovingian.50000
So I think I may need to add /usr/local/monetdb/bin/ to my bash PATH.
Adding it to my Sys.path may be needed as well because the help page example
still fails:
> library(MonetDB.R)
Loading required package: DBI
Loading required package: digest
> conn <- dbConnect(MonetDB.R(), "monetdb://localhost/demo")
Error in .monetAuthenticate(socket, dbname, user, password, language =
language) :
Authentication error: !monetdbd: no such database 'demo', please create it
first
> Sys.getenv()['PATH']
PATH
"/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin"
I finally decide that was not needed after working through a bit more of the
documentation going back and forth between the bash console and the R console:
> conn <- dbConnect(MonetDB.R(),
> "monetdb://david-winsemiuss-mac-pro.local/demo")
Error in .monetAuthenticate(socket, dbname, user, password, language =
language) :
Authentication error: !monetdbd: no such database 'demo', please create it
first
So I tried creating it with:
david-winsemiuss-mac-pro:~ davidwinsemius$ /usr/local/monetdb/bin/monetdb
create demo
created database in maintenance mode: demo
> conn <- dbConnect(MonetDB.R(),
> "monetdb://david-winsemiuss-mac-pro.local/demo")
Error in .monetAuthenticate(socket, dbname, user, password, language =
language) :
Authentication error: !monetdbd: database 'demo' is under maintenance
So I ran the next command from the MonetDB documentation:
david-winsemiuss-mac-pro:~ davidwinsemius$ /usr/local/monetdb/bin/monetdb start
demo
starting database 'demo'... done
Then the example code runs:
> conn <- dbConnect(MonetDB.R(),
> "monetdb://david-winsemiuss-mac-pro.local/demo")
> dbListTables(conn)
character(0)
> data(iris)
> dbWriteTable(conn, "iris", iris)
[1] TRUE
> dbGetQuery(conn, "SELECT COUNT(*) FROM iris;")
L1
1 150
> d <- dbReadTable(conn, "iris")
> str(d)
'data.frame': 150 obs. of 5 variables:
$ sepal_length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
$ sepal_width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
$ petal_length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
$ petal_width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
$ species : chr "setosa" "setosa" "setosa" "setosa" ...
I still need to add the ../monetdb/bin location to my bash PATH, but I think I
can figure than out
Thank you for your assistance, Thomas.
--
David
>
> After exiting R
> /usr/local/monetdb/bin/monetdbd start ~/my-dbfarm
>
>
> -thomas
>
>
>
>
> On Wed, May 7, 2014 at 2:53 PM, David Winsemius <[email protected]>
> wrote:
>> Dear Hannes or anybody;
>>
>> I did not find any pages (despite searching) for the installation process of
>> MonetDB on a Mac. I'm currently running MacOS 10.7.5 and R 3.1.0 Patched
>> (2014-04-21 r65431) -- "Spring Dance". There is a source package for MonetDB
>> at:
>>
>> https://www.monetdb.org/downloads/MacOSX/Jan2014-SP1/MonetDB-11.17.13-x86_64-Darwin-9-bin.tar.bz2
>>
>> It's home page has direction for installation on Linux and PC but makes no
>> mention of Macs. Downloading that file resulted in a couple of automatic
>> steps and the creation in my ~/Download/ directory of a hierarchy of
>> usr2/local/monetdb
>>
>> Reading the MacOS R-FAQ in "For R.app you may need to add e.g.
>> /usr/local/bin and it is usually most convenient to use command-line R."
>> Reasoning that the files in monetdb should actually go into usr/local/ I
>> dragged them to that location with Finder.app, and authenticated when
>> requested.
>>
>> (This process failed and I am now looking for instruction on properly
>> installing on a Mac. Is this page going to lead me on the path of
>> righteousness?
>>
>> https://developer.apple.com/library/mac/documentation/porting/conceptual/portingunix/compiling/compiling.html
>>
>> My reading of Mac-SIG leads me to believe that using MacPorts will not be a
>> stable strategy for interaction with R.
>>
>> --
>> David.
>>
>> ========= failed efforts recorded below ==================
>>
>> I installed MonetDB.R from R.app using the Package installation dialog with
>> "install dependencies" checked.
>>
>> library(MonetDB.R) # succeeded without complaint and reported:
>>
>> Loading required package: DBI
>> Loading required package: digest
>>
>> help(package="MonetDB.r") # Trying the Example code in monetdb.server.setup
>>
>>> startscript <- monetdb.server.setup("/tmp/database","/usr/local/monetdb/",
>>> "db1", 50001)
>>> pid <- monetdb.server.start(startscript)
>> /private/tmp/database/db1.sh: line 2: /usr/local/monetdb/mserver5: No such
>> file or directory
>> Read 1 item
>>> monetdb.server.stop(pid)
>> /bin/sh: line 0: kill: (22661) - No such process
>>> conn <- dbConnect(MonetDB.R(), "monetdb://localhost:50001/db1")
>> Error in .local(drv, ...) : Could not connect to localhost:50001
>>
>>
>> Then tried the code on the help page for 'MonetDB.R-package'
>>
>>> conn <- dbConnect(MonetDB.R(), "monetdb://localhost/demo")
>> Error in .local(drv, ...) : Could not connect to localhost:50000
>>> dbListTables(conn)
>> Error in is(object, Cl) :
>> error in evaluating the argument 'conn' in selecting a method for function
>> 'dbListTables': Error: object 'conn' not found
>>> data(iris)
>>> dbWriteTable(conn, "iris", iris)
>> Error in is(object, Cl) :
>> error in evaluating the argument 'conn' in selecting a method for function
>> 'dbWriteTable': Error: object 'conn' not found
>>> dbGetQuery(conn, "SELECT COUNT(*) FROM iris;")
>> Error in dbGetQuery(conn, "SELECT COUNT(*) FROM iris;") :
>> error in evaluating the argument 'conn' in selecting a method for function
>> 'dbGetQuery': Error: object 'conn' not found
>>> d <- dbReadTable(conn, "iris")
>> Error in is(object, Cl) :
>> error in evaluating the argument 'conn' in selecting a method for function
>> 'dbReadTable': Error: object 'conn' not found
>>
>> So obviously there is something about this client server setup that I have
>> not done properly or understood how to access. I've been through the R-FAQ
>> many times and still do not understand the issues surrounding the use of
>> homebrew and MacPorts. It's something to do with binary files in the right
>> places and I fear this is another instance of such failure.
>>
>> (I'm also unable to scroll the Mac-FAQ to see the end of the file when the
>> window is wider than about 60 characters.)
>> --
>> David Winsemius
>> Alameda, CA, USA
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [email protected]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
>
> --
> Thomas Lumley
> Professor of Biostatistics
> University of Auckland
David Winsemius
Alameda, CA, USA
_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac