Single node Apache Trafodion 2.1, running on top of HDP 2.4
3.4K
[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
yum install docker-engineservice docker startat least 4GB memory for your Linux host which runs docker.
docker pull trafodion/quickstart:2.1
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.
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();
}
}
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>
run dokcer ps to get your container ID, and use docker stop {container_id} to stop it.
Content type
Image
Digest
Size
8 GB
Last updated
about 9 years ago
docker pull trafodion/quickstart:2.1