Install from tarball

Machbase provides a zipped binary file that each individual can customize it for their environments.

List of Contents

Installation guide

Create Account

Create a Linux user account as 'mach'.

sudo useradd mach

Install Package

Create an MACHBASE_HOME directory, and then copy it to the downloaded package.

[mach@localhost ~]$ wget http://www.machbase.com/dist/machbase-std-3.5.0.826b8f2.official-LINUX-X86-64-release.tgz       
[mach@localhost ~]$ mkdir machbase_home        
[mach@localhost ~]$ mv machbase-std-3.5.0.826b8f2.official-LINUX-X86-64-release.tgz      
  machbase_home/      
[mach@localhost ~]$ cd machbase_home/      
[mach@localhost machbase_home]$  tar zxf machbase-std-3.5.0.826b8f2.official-LINUX-X86-64-release.tgz       
[mach@localhost machbase_home]$ ls -al        
total 71096      
drwxrwxr-x 16 mach mach     4096 Aug  8 22:56 .      
drwx------ 16 mach mach     4096 Aug  8 22:55 ..      
drwxrwxr-x  6 mach mach       87 Aug  8 08:42 3rd-party      
drwxrwxr-x  2 mach mach     4096 Aug  8 08:42 bin      
drwxrwxr-x  6 mach mach     4096 Aug  8 08:42 collector      
drwxrwxr-x  2 mach mach       56 Aug  8 08:42 conf      
drwxrwxr-x  2 mach mach        6 Aug  8 08:42 dbs      
drwxrwxr-x  3 mach mach       21 Aug  8 08:42 doc      
drwxrwxr-x  2 mach mach       88 Aug  8 08:42 include      
-rw-rw-r--  1 mach mach 72780339 Aug  8 22:54 machbase-std-3.5.0.826b8f2.official-LINUX-X86-64-release.tgz      
drwxrwxr-x  2 mach mach       62 Aug  8 08:42 install      
drwxrwxr-x  2 mach mach     4096 Aug  8 08:42 lib      
drwxrwxr-x  2 mach mach        6 Aug  8 08:42 meta      
drwxrwxr-x  2 mach mach       40 Aug  8 08:42 msg      
drwxrwxr-x  8 mach mach       73 Aug  8 08:42 sample      
drwxrwxr-x  2 mach mach        6 Aug  8 08:42 trc      
drwxrwxr-x  3 mach mach       18 Aug  8 08:42 webadmin      
[mach@localhost machbase_home]$

Table. Description of directory

Directory Description
bin Executable files
collector Sample of log collection agent
conf configuration files
dbs Data storage
doc Licenses files
include Various header files for CLI program
install MK file for Makefile
lib Various libraries
msg Warning and error messages from Machbase Server
sample Various sample files
trc Logs and trace contents of Machbase server
webadmin Webadmin files
3rd-party td-agent and log4j files

Set Environment Variables

It sets the execution path and dynamic library. In the case of bash, put the script below in the .bashrc file as follows.

export MACHBASE\_HOME=/home/mach/machbase\_home  
export PATH=$MACHBASE\_HOME/bin:$PATH  
export LD\_LIBRARY\_PATH=$MACHBASE\_HOME/lib:$LD\_LIBRARY\_PATH

The changes will be applied by using the following command:

source .bashrc

Set Machbase Environment

There is a sample configuration file in $MACHBASE_HOME/conf. You can use the sample file below for configuration.

[mach@localhost ~\]$ cd $MACHBASE\_HOME/conf  
[mach@localhost conf\]$ ls -al  
total 28  
drwxrwxr-x.  2 mach mach    56 Aug 10 02:48 .  
drwxrwxr-x. 16 mach mach  4096 Aug  8 23:17 ..  
-rw-rw-r--.  1 mach mach 18127 Aug  8 09:15 machbase.conf.sample  
-rw-rw-r--.  1 mach mach  1364 Aug  8 09:15 machcollector.conf  
[mach@localhost conf\]$

You can also set the connection port variable in Linux environment settings. When the variable is set as shown below, it takes priority over the default settings.

export MACHBASE\_PORT\_NO=7878

Start-up

Create the Database

You can create a database with machadmin utility. You can use "--help" command to check command options.

[mach@localhost machbase\_home\]$ machadmin --help
---------------------------------------------------------
 Machbase Administration Tool
 Release Version - 3.5.0.826b8f2.official 
 Copyright 2014, Machbase Inc. or its subsidiaries
 All Rights Reserved
 ---------------------------------------------------------
<<Available option lists>>  
  -u, --startup                         Startup Machbase server.  
      --recovery\[=simple,complex,reset\] Recovery mode. \(default: simple\)  
  -s, --shutdown                        Shutdown Machbase server.  
  -c, --createdb                        Create Machbase database.  
  -d, --destroydb                       Destroy Machbase database.  
  -k, --kill                            Terminate Machbase server.  
  -i, --silence                         Produce less output.  
  -r, --restore                         Restore Machbase database.  
  -x, --extract                         Extract BackupFile to BackupDirectory.  
  -w, --viewimage                       Display information of BackupImageFile.  
  -e, --check                           Check whether Machbase Server is running.  
  -t, --licinstall                      Install the license file.  
  -f, --licinfo                         Display information of installed license file.

[mach@localhost machbase\_home\]$

It creates the database as follows:

[mach@localhost machbase\_home\]$ machadmin -c
-----------------------------------------------------
 Machbase Administration Tool
 Release Version - 3.5.0.826b8f2.official 
 Copyright 2014, Machbase Inc. or its subsidiaries
 All Rights Reserved
-----------------------------------------------------
Database created successfully.  
[mach@localhost machbase\_home\]$

It changes the directory to $MACHBASE_HOME/dbs and check the created file.

[mach@localhost machbase\_home\]$ cd $MACHBASE\_HOME/dbs  
[mach@localhost dbs\]$ ls -al  
total 72  
drwxrwxr-x.   3 mach mach    98 Aug  8 23:19 .  
drwxrwxr-x.  16 mach mach  4096 Aug  8 23:17 ..  
-rw-r--r--.   1 mach mach 27648 Aug  8 23:19 meta.dbs-0  
-rw-r--r--.   1 mach mach 31744 Aug  8 23:19 meta.dbs-1  
-rw-r--r--.   1 mach mach  3072 Aug  8 23:19 meta.dbs-2  
-rw-r--r--.   1 mach mach     0 Aug  8 23:19 meta.dbs-3  
drwxrwxr-x. 103 mach mach  4096 Aug  8 23:19 SYSTEM\_TABLESPACE  
[mach@localhost dbs\]$

Start the Machbase Server

You can start Machbase server via machadmin with -u option.

[mach@localhost ~\]$ machadmin -u
-------------------------------------------------

 Machbase Administration Tool
 Release Version - 3.5.0.826b8f2.official 
 Copyright 2014, Machbase Inc. or its subsidiaries
 All Rights Reserved

-------------------------------------------------
Waiting for Machbase process start.  
Startup completed.  
[Mach@localhost ~\]$

You can check if the machbased, a server daemon, is running via the ps command as follows.

[mach@localhost ~\]$ ps -ef \| grep machbased  
mach     11665      1  1 23:27 ?        00:00:00 /home/mach/machbase\_home/bin/machbased -s --recovery=simple  
mach     11687  11558  0 23:27 pts/0    00:00:00 grep --color=auto machbased  
\[Mach@localhost ~\]$

Access with machsql

An access utility called machsql is provided in $MACHBASE_HOME/bin/. It can be conducted as follows. For details, SYS is the default user ID, and the password is set to MANAGER.

[mach@localhost ~\]$ machsql
=================================================================
     Machbase Client Query Utility
     Release Version 3.5.0.826b8f2.official
     Copyright 2015, Machbase Inc. or its subsidiaries.
     All Rights Reserved.

=================================================================  
    Machbase server address \(Default:127.0.0.1\):  
    Machbase user ID  \(Default:SYS\)  
    Machbase user password:   
    MACHBASE\_CONNECT\_MODE=INET, PORT=5656  
    Mach&gt;

You can retrieve the meta table with the list below. m$tables displays the list of meta tables. m$sys_tables indicates a list of tables that users created.

Mach> select * from m$tables;
NAME                                      TYPE        DATABASE_ID          ID                   USER_ID     COLCOUNT    
-------------------------------------------------------------------------------------------------------------------------------
M$SYS_COLLECTOR_COLUMNS                   1           -1                   1000047              0           11          
M$COLUMNS                                 1           -1                   1000041              0           13          
M$SYS_COLUMNS                             1           -1                   1000040              0           13          
M$SYS_INDEX_COLUMNS                       1           -1                   1000043              0           9           
M$SYS_COLLECTOR_SOURCES                   1           -1                   1000048              0           7           
M$SYS_TABLESPACE_DISKS                    1           -1                   1000020              0           8           
M$SYS_COLLECTORS                          1           -1                   1000046              0           25          
M$SYS_TABLES                              1           -1                   1000036              0           8           
M$TABLES                                  1           -1                   1000038              0           8           
M$SYS_INDEXES                             1           -1                   1000042              0           15          
M$SYS_USERS                               1           -1                   1000044              0           4           
M$SYS_TABLESPACES                         1           -1                   1000016              0           5           
M$SYS_COLLECTORMANAGERS                   1           -1                   1000045              0           7           
[13] row(s) selected.
Elapsed time: 0.002
Mach>

The source code below shows how to create a table, and insert and select data.

Mach> create table hello(id integer);
Created successfully.
Elapsed time: 0.009
Mach> insert into hello values(1);
1 row(s) inserted.
Elapsed time: 0.000
Mach> insert into hello values(2);
1 row(s) inserted.
Elapsed time: 0.001
Mach> select * from hello;
ID          
--------------
2           
1           
[2] row(s) selected.
Elapsed time: 0.000
Mach> select _arrival_time, * from hello;
_arrival_time                   ID          
-----------------------------------------------
2016-08-08 23:29:33 432:367:000 2           
2016-08-08 23:29:31 429:953:000 1           
[2] row(s) selected.
Elapsed time: 0.001
Mach>

When looking at the result of SELECT above, the last inserted record is displayed first. Also, "_arrival_time" column shows that the input time of the record is represented in a nanosecond.

Shutdown the Machbase Server

It shutdowns the server by executing "-s" option of machadmin.

[mach@localhost ~\]$ machadmin -s
-------------------------------------------------------
  Machbase Administration Tool
 Release Version - 3.5.0.826b8f2.official 
 Copyright 2014, Machbase Inc. or its subsidiaries
 All Rights Reserved

-------------------------------------------------------

Waiting for shut down server...  
Server shut down successfully.  
[mach@localhost ~\]$

Delete the Database

"-d" option of machamin is used to delete the database.

[mach@localhost ~]$ machadmin -d

-----------------------------------------------------------------
     Machbase Administration Tool
     Release Version - 3.5.0.826b8f2.official 
     Copyright 2014, Machbase Inc. or its subsidiaries
     All Rights Reserved
-----------------------------------------------------------------
Destroy Machbase database. Are you sure?(y/N) Y
Database destroyed successfully.
[mach@localhost machbase_home]$

All data will be deleted, so use it with caution.

results matching ""

    No results matching ""