Public Repository

Last pushed: 2 months ago
Short Description
Single node Apache Trafodion 2.1, running on top of HDP 2.4
Full Description

Apache WebPage:

http://trafodion.apache.org

Install docker:

  1. Edit /etc/yum.repos.d/docker-main.repo :
    [docker-main-repo]
    name=Docker main Repository
    baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever
    enabled=1
    gpgcheck=1
    gpgkey=https://yum.dockerproject.org/gpg
    
  2. Install docker: yum install docker-engine
  3. Start docker daemon: service docker start

System Requirement:

at least 4GB memory for your Linux host which runs docker.

Fetch image:

docker pull trafodion/quickstart:2.1

Run:

docker run -it --privileged=true -h 59b3d431c55c --name=59b3d431c55c -p 8080:8080 -p 23400-23405:23400-23405 -p 4200-4206:4200-4206 -p 24400:24400 trafodion2.1 start
options explanation:

-d                                    Run in daemon mode
-h  [hostname]                        Specify the docker hostname
-p  [hostport:dockerport]             Map the port from host to docker
--privileged=true                     Required

start is used to start all Hadoop and Trafodion services while docker is starting.
Trafodion will be started automatically within 5 minutes (if not, please start Hadoop manually from Hadoop webpage: http://localhost:8080). Then you can ssh to the docker:

ssh -p 2201 trafodion@localhost

The password of trafodion is traf123.

check trafodion running status using sqcheck:

[trafodion@trafdocker ~]$ sqcheck
Checking if processes are up.
Checking attempt: 1; user specified max: 2. Execution time in seconds: 0.

The SQ environment is up!


Process        Configured    Actual        Down
-------        ----------    ------        ----
DTM                2        2        
RMS                4        4        
DcsMaster          1        1        
DcsServer          1        1        
mxosrvr            2        2

If not up, please use sqstart to start Trafodion 2.1
run trafodion CLI using trafci:

[trafodion@trafdocker ~]$ trafci

Welcome to Apache Trafodion Command Interface 
Copyright (c) 2015-2016 Apache Software Foundation

Host Name/IP Address: localhost:23400
User Name: zz

Connected to Trafodion 

SQL>get tables;

Tables in Schema TRAFODION.SEABASE
==================================

TEST01

--- SQL operation complete.

JDBC connection:

Copy JDBC driver jar file from the docker to host:
scp -P 2201 trafodion@localhost:/home/trafodion/trafodion-2.1.0/export/lib/jdbcT4.jar /path/to/jdbcT4.jar

Add jar file to CLASSPATH:
export CLASSPATH=$CLASSPATH:/path/to/jdbcT4.jar

Then you can use JDBC to connect Trafodion from host, below is a sample JAVA code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
public class con {
    protected static String url = "jdbc:t4jdbc://172.17.0.2:23400/:";     //set your docker's IP address
    protected static String driverClass = "org.trafodion.jdbc.t4.T4Driver";
    protected static String user = "zz";
    protected static String pwd = "zz";
    protected static Connection conn;
    public static void main(String[] args) throws Exception {
        Class.forName(driverClass);
        conn = DriverManager.getConnection(url, user, pwd);
        String sql = "select * from test01";
        PreparedStatement ps = conn.prepareStatement(sql);
        ResultSet rs = ps.executeQuery();
        while (rs.next()){
            System.out.println(rs.getString(1));
        }
        ps.close();
        conn.close();
    }
}
JDBC connect from another host

Modify /home/trafodion/trafodion-2.1.0/dcs-2.1.0/conf/dcs-site.xml within docker, remove below section:

   <property>
    <name>dcs.dns.interface</name>
    <value>eth0</value>
  </property>

Add below section:

<property>
<name>dcs.cloud.command</name>
<value>echo {docker's ip}, {host's ip}</value>
</property>

For example:

<value>echo 172.17.0.2, 192.168.1.1</value>

Stop:

run dokcer ps to get your container ID, and use docker stop {container_id} to stop it.

Docker Pull Command
Owner
trafodion

Comments (3)
alexagon
2 months ago

Hi,

The certificate in the image is expired, so I generated a new one. But I'm still unable to make it work:

* ERROR[1] The message id: as_connect_message_error With parameters: server handle not available

trafodion
a year ago

Hi ritchiewang,

you have to setup dcs.cloud.command in dcs-site.xml.
See full description for details.

ritchiewang
a year ago

I can use it in docker, but how can I connect it from outsides?