您的位置:首页 > 其它

MonetDB用户指南2——MonetDBServer

2013-10-17 23:44 381 查看
原文:http://www.monetdb.org/Documentation/monetdbd

在1个数据库实例只能运行1个monetdbd,但是1个服务器上可以启动多个monetdbd。

In the simple case, monetdbd is started by the system through some init script, and databases are created by the local DBA, and assigned to users. A more flexible approach for users, however, is the case where a user runs monetdbd itself. Because a dbfarm
can be anywhere in the filesystem, and needs nothing more than just being an ordinary directory, a user can use monetdbd to initialise his/her own dbfarm in an accessible place. For example:

在一般的情况下,monetdbd是由DBA开始,通过一些脚本创建的数据库,最终分配给用户。更灵活的方法,是其中一个用户运行一个monetdbd实例。这主要是因为dbfarm可以在文件系统的任何地方,仅仅是一个普通目录,用户可以使用monetdbd初始化自己的数据库。比如:

monetdbd create ~/my-dbfarm

After creation of the personal dbfarm directory, the get command can be used to inspect the dbfarm-wide settings of the newly created environment. Note that the above output differs per system,
per user and per dbfarm. Important setting is the port to use to open up services for clients. In particular for a user installation, these often may conflict with another running monetdbd, hence it is wise to change these to a private port in situations
where such conflicts may arise:

dbfarm目录创建后,get命令可以用来检查dbfarm宽的新创建的环境设置。请注意,每个系统,每个用户和每个dbfarm上述输出不同。重要的设置是使用开放的服务端口。这些通常会与另一个运行monetdbd冲突。
monetdbd get all ~/my-dbfarm
monetdbd set port=54321 ~/my-dbfarm
改变端口,采用set设置为54321
下一步是启动数据库
monetdbd start ~/my-dbfarm
If the above command returned without any message, the monetdbd process was successfully started. The logfile (default merovingian.log) should show that the daemon has started, bound some ports, and discovered
itself.
如果没有任何信息,说明启动正常。日志文件会记录守护进程已经启动。

From this part on, monetdbd can be given commands through the
monetdb
command (without the trailing 'd'). The monetdb client utility knows commands much like monetdbd, but it is much more focussed towards giving information about what is going
on inside monetdbd. The monetdb client utility is the main tool to use to manage the dbfarm.

The dbfarm we created is empty, as such there are no databases inside it. With monetdb we can create a new database:

完成以上工作后,我们可以通过monetdb向monetdbd发送命令。monetdb工具与monetdbd相似,可以更几种的使用所有命令。monetdb是主要的管理工具。

我们可以创建新的数据库。

monetdb create my-first-db

查看状态

monetdb -p54321 status

我们可以用mclent登录,它可以执行sql语句

mclient -p54321 -dmy-first-db

sql>select 'hello'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: