Recital

Login Register

This article looks at the range of client access mechanisms for Windows that can be used with the Recital C-ISAM Bridge and details bridge configuration and usage.

Overview

Just because the format of data is regarded as 'legacy' does not make that data in any way obsolete. Modern client interfaces can not only extend the life of long-term data, but also provide different ways to analyse and gain advantage from that data.

Recital Corporation provides a range of solutions to interface to Informix compliant C-ISAM data on Linux or UNIX from Windows clients.

.NET

Click image to display full size

Fig 1: Recital Mirage .NET application accessing the C-ISAM Demo table.


Recital offers two alternative ways to access C-ISAM data using Microsoft .NET:

The Recital .NET Data Provider is a managed Data Provider written in C# that provides full compatibility with the Microsoft SQLserver and OLE DB data providers that ship with the .NET framework. It is fully integrated with the Visual Studio .NET IDE supporting data binding and automatic code generation using the form designer. The Recital .NET Data Provider works in conjunction with the Recital Database Server for Linux or UNIX to access C-ISAM data.

Recital Mirage .NET is a complete solution for migrating, developing and deploying 4GL database applications. Recital Mirage .NET works in conjunction with the Recital Mirage .NET Application Server for Linux or UNIX to access C-ISAM data.

JDBC

Click image to display full size

Fig 2: Java™ Swing JTable accessing the C-ISAM Demo table via the Recital JDBC Driver.


The Recital JDBC Driver is an all Java Type 4 JDBC 3.0 Driver, allowing you to access C-ISAM data from Java applets and applications. The Recital JDBC Driver works in conjunction with the Recital Database Server for Linux or UNIX to access C-ISAM data.

ODBC

Click image to display full size

Fig 3: Microsoft® Office Excel 2003 Pivot Chart and Pivot Table accessing the C-ISAM Demo table via the Recital ODBC Driver.


The Recital ODBC Driver is an ODBC 3.0 Driver, allowing you to access C-ISAM data from your preferred ODBC based Windows applications. You can develop your own applications in languages such as C++ or Visual Basic, manipulate the data in a spreadsheet package or word processor document and design charts, graphs and reports. The Recital ODBC Driver works in conjunction with the Recital Database Server for Linux or UNIX to access C-ISAM data.

Configuring the Recital C-ISAM Bridge

Data access is achieved through a C-ISAM Bridge.  This requires the creation of an empty Recital table that has the same structure as the C-ISAM file and of a RecitalC-ISAM Bridge file.

On Linux and UNIX, Recital Terminal Developer and the Recital Database Server come complete with an example C-ISAM data file, C-ISAM index and Recital C-ISAM bridge that can be used for testing and as a template for configuring your own C-ISAM bridges.  The Recital Database Server also includes a bridge creation ini file.

Step 1:

Create a Recital table with the same structure as the C-ISAM file.  The fields/columns in the structure file must exactly match the data type and length of those in the C-ISAM file.  The Recital table will have one byte more in total record length due to the Recital record deletion marker.

To create the table, use the SQL CREATE TABLE command or the Recital Terminal Developer CREATE worksurface.  The SQL CREATE TABLE command can be called directly:

SQLExecDirect:
  In:      hstmt = 0x00761BE8,
    szSqlStr = "CREATE TABLE cisamdemo.str (DD Char(4)
              DESCRIPTION "Dd...", cbSqlStr = -3
  Return:  SQL_SUCCESS=0

or be included in a 4GL program:

// createtab.prg
CREATE TABLE cisamdemo.str;
    (DD Char(4) DESCRIPTION "Dd",;
     CONFIRM Char(6) DESCRIPTION "Confirm",;
     PROCDATE Char(6) DESCRIPTION "Procdate",;
     CONTROL Char(5) DESCRIPTION "Control",;
     DOLLARS Decimal(13,2) DESCRIPTION "Dollars",;
     DEALER Char(5) DESCRIPTION "Dealer",;
     TERRITORY Char(2) DESCRIPTION "Territory",;
     WOREP Char(12) DESCRIPTION "Worep",;
     CURRTRAN Char(3) DESCRIPTION "Currtran",;
     TRADDATE Char(6) DESCRIPTION "Traddate",;
     CITY Char(10) DESCRIPTION "City",;
     ACCOUNT Char(11) DESCRIPTION "Account",;
     PRETRAN Char(2) DESCRIPTION "Pretran",;
     AFSREP Char(14) DESCRIPTION "Afsrep",;
     REPKEY Char(9) DESCRIPTION "Repkey",;
     BRANCH Char(3) DESCRIPTION "Branch",;
     WODEALER Char(5) DESCRIPTION "Wodealer",;
     BANKCODE Char(2) DESCRIPTION "Bankcode",;
     COMMRATE Decimal(6,4) DESCRIPTION "Commrate",;
     NEWREP Char(1) DESCRIPTION "Newrep",;
     SETTLE Char(1) DESCRIPTION "Settle",;
     POSTDATE Char(6) DESCRIPTION "Postdate")
if file("cisamdemo.str")
    return .T.
else
    return .F.
endif
// end of createtab.prg

Server-side 4GL programs can be called by all clients, e.g. from a Java class with a JDBC connection:

//---------------------------------
//-- create_str.java --
//---------------------------------
import java.sql.*;
import java.io.*;
import Recital.sql.*;

public class create_str {

  public static void main(String argv[]) {
    try {
      new RecitalDriver();
      String url = "jdbc:Recital:" +
        "SERVERNAME=cisamserver;" +
        "DIRECTORY=/usr/recital/data/southwind;" +
        "USERNAME=user;" +
        "PASSWORD=password";
      Connection con = DriverManager.getConnection(url, "user", "pass");
      Statement stmt = con.createStatement();

      CallableStatement sp = con.prepareCall("{call createtab}");
      boolean res = sp.execute();
      String outParam = sp.getString(1);
      System.out.println("Returned "+outParam);
      sp.close();
      con.close();
    } catch (Exception e) {
      System.out.flush();
      System.err.flush();
      DriverManager.println("Driver exception: " + e.getMessage());
      e.printStackTrace();
    }
    try {
      System.out.println("Press any key to continue...");
      System.in.read();
    } catch(IOException ie) {
      ;
    }
  }
}

The table should be given a ‘.str’ file extension (rather than the default ‘.dbf’) to signify that this is a structure file only.

Please see the end of this article for information on matching Informix and Recital data types



Fig 4: Recital CREATE/MODIFY STRUCTURE worksurface for character mode table creation.

Step 2: Creating the Bridge File

If you have Recital installed on the server platform, the Bridge File can be created using the CREATE BRIDGE worksurface.  The corresponding command to modify the bridge file is MODIFY BRIDGE <bridge file>.  This is the cisamdemo.dbf bridge file in the CREATE/MODIFY BRIDGE WORKSURFACE:

> modify bridge cisamdemo.dbf


Fig 5: Recital CREATE BRIDGE/MODIFY BRIDGE worksurface for bridge creation.

For Recital Database Server clients, the Bridge File can be created using the Recital/SQL CREATE BRIDGE command:

Recital/SQL CREATE BRIDGE:
CREATE BRIDGE cisamdemo.dbf;
  TYPE "CISAM";
  EXTERNAL "cisamdemo.dat";
  METADATA "cisamdemo.str";
  ALIAS "cisamdemo"

or:

CREATE BRIDGE cisamdemo.dbf;
  AS "type=CISAM;external=cisamdemo.dat;metadata=cisamdemo.str;alias=cisamdemo"

The examples above assume that the C-ISAM file, the bridge file and the Recital structure file are all in the current working directory.  Full path information can be specified for the <externalname> and the <databasename>.  For added flexibility, environment variables can be used to determine the path at the time the bridge is opened.  Environment variables can be included for either or both the <externalname> and the <databasename>.  A colon should be specified between the environment variable and the file name.

e.g.

  CREATE BRIDGE cisamdemo.dbf;
  TYPE "CISAM";
  EXTERNAL "DB_DATADIR:cisamdemo";
  METADATA "DB_MIRAGE_PATH:cisamdemo.str";
  ALIAS "cisamdemo"
Recital CREATE BRIDGE/MODIFY BRIDGE worksurface:


Fig 6: Recital CREATE BRIDGE/MODIFY BRIDGE worksurface - using environment variables.

Using the Bridge

The Bridge can now be used.  To access the C-ISAM file, use the ‘alias’ specified in the Bridge definition.

SQL:
SELECT * FROM cisamdemo
Recital/4GL:
use cisamdemo

Indexes

The cisamdemo.dat file included in the Recital distributions for Linux and UNIX has three associated index keys in the cisamdemo.idx file:

Select area: 1
Database in use: cisamdemo
Alias: cisamdemo
Number of records: 4
Current record: 2
File Type: CISAM (C-ISAM)
Master Index: [cisamdemo.idx key #1]
Key: DD+CONFIRM+PROCDATE+CONTROL
Type: Character
Len: 21   (Unique)
Index: [cisamdemo.idx key #2]
Key: DD+SUBSTR(CONFIRM,2,5)+TRADDATE+STR(DOLLARS,13,2) +CURRTRAN+ACCOUNT Type: Character Len: 42 Index: [cisamdemo.idx key #3] Key: DEALER+BRANCH+AFSREP+SUBSTR(PROCDATE,5,2) +SUBSTR(CONTROL,2,4) Type: Character Len: 28

The Recital C-ISAM bridge makes full use of the C-ISAM indexes.  SQL SELECT statements with WHERE clauses are optimized based on any of the existing indexes when possible.  The following ODBC SELECT call makes use of key #3 rather than sequentially searching through the data file.

SQLExecDirect:
  In:      hstmt = 0x00761BE8,
    szSqlStr = "select * from cisamdemo
      where dealer+branch+afsrep=' 00161   595-7912",
      cbSqlStr = -3
  Return:  SQL_SUCCESS=0

Get Data All:

"DD", "CONFIRM", "PROCDATE", "CONTROL", "DOLLARS", "DEALER", 
"TERRITORY", "WOREP", "CURRTRAN", "TRADDATE", "CITY", "ACCOUNT", 
"PRETRAN", "AFSREP", "REPKEY", "BRANCH", "WODEALER", "BANKCODE", 
"COMMRATE", "NEWREP", "SETTLE", "POSTDATE"

"0159", " 15522", "930312", "13356", 4992.60, "00161", "19", 
"", "210", "930305", "", "70000100009", "", "595-7912", 
"930315791", "", "", "59", 0.0000, "1", "", "930315"
1 row fetched from 22 columns.

Using the Recital/4GL, the primary index is set as the master index when the bridge is first opened.  Any secondary indexes can be selected using the SET ORDER TO <expN> command.  The Recital/4GL SEEK or FIND commands and SEEK() function can be used to search in the current master index.

> SET ORDER TO 3
Master index: [cisamdemo.idx key #3]
> SEEK “00161   595-7912”

Appendix 1: Data Types

Informix

Recital

Byte

Numeric

Char

Character

Character

Character

Date

Date

Datetime

Character

Decimal

Numeric

Double Precision

Float

Float

Real

16 Bit Integer

Short

Integer

Numeric

Interval

Character

32 Bit Long

Integer

Money

Numeric

Numeric

Numeric

Real

Numeric

Smallfloat

Numeric

Smallint

Numeric

Text

Unsupported

Varchar

Character

Appendix 2: C-ISAM RDD Error Messages

The following errors relate to the use of the Recital CISAM Replaceable Database Driver (RDD).  They can be received as an ‘errno <expN>’ on Recital error messages:


ERRNO()

Error Description

100

Duplicate record

101

File not open

102

Invalid argument

103

Invalid key description

104

Out of file descriptors

105

Invalid ISAM file format

106

Exclusive lock required

107

Record claimed by another user

108

Key already exists

109

Primary key may not be used

110

Beginning or end of file reached

111

No match was found

112

There is no “current” established

113

Entire file locked by another user

114

File name too long

115

Cannot create lock file

116

Memory allocation request failed

117

Bad custom collating

118

Duplicate primary key allowed

119

Invalid transaction identifier

120

Exclusively locked in a transaction

121

Internal error in journaling

122

Object not locked

Published in Blogs
Read more...

Warnings

This is a sample info message. Use <p class="gkInfo1">Your info message goes here!</p>.

This is a sample tips message. Use <p class="gkTips1">Your tips goes here!</p>.

This is a sample warning message. Use <p class="gkWarning1">Your warning message goes here!</p>.

This is a sample info message. Use <p class="gkInfo2">Your info message goes here!</p>.

This is a sample tips message. Use <p class="gkTips2">Your tips goes here!</p>.

This is a sample warning message. Use <p class="gkWarning2">Your warning message goes here!</p>.

This is a sample info message. Use <p class="gkInfo3">Your info message goes here!</p>.

This is a sample tips message. Use <p class="gkTips3">Your tips goes here!</p>.

This is a sample warning message. Use <p class="gkWarning3">Your warning message goes here!</p>.

This is a sample info message. Use <p class="gkInfo4">Your info message goes here!</p>.

This is a sample tips message. Use <p class="gkTips4">Your tips goes here!</p>.

This is a sample warning message. Use <p class="gkWarning4">Your warning message goes here!</p>.

This is a sample info message. Use <p class="gkInfo5">Your info message goes here!</p>.

This is a sample tips message. Use <p class="gkTips5">Your tips goes here!</p>.

This is a sample warning message. Use <p class="gkWarning5">Your warning message goes here!</p>.

Headers

This is heading 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer semper egestas nunc in volutpat. Fusce adipiscing velit ac eros tempor iaculis. Phasellus venenatis mollis augue, non posuere odio placerat in. Etiam volutpat ultrices lectus. Fusce eu felis erat. Donec congue interdum elit, sed ornare magna convallis lacinia. In hac habitasse platea dictumst. Mauris volutpat consectetur accumsan.

This is heading 2

Cras diam justo, sodales quis lobortis sed, lobortis vel mauris. Sed a mollis nunc. Quisque semper condimentum lectus, eget laoreet ipsum auctor et. Quisque sagittis luctus augue, id fringilla enim euismod quis. Nullam blandit, elit at euismod rutrum, tortor nibh posuere mauris, in volutpat diam ante ac dui. Sed velit massa, imperdiet placerat tristique et, consectetur a lorem. Praesent aliquet turpis in quam tempor eu pulvinar nibh luctus.

This is heading 3

Vivamus rhoncus arcu sit amet est tristique convallis nec vel eros. Vestibulum euismod luctus velit quis porta. Aliquam varius placerat mauris sed vehicula. Integer porta facilisis sapien, in tempus lorem mattis molestie. Suspendisse potenti. Praesent quis diam non dolor convallis mattis eu id nulla.

This is heading 4

Proin urna erat, egestas vel consectetur at, accumsan at purus. Donec est risus, facilisis dignissim placerat nec, euismod lacinia nisi. Nam ac sem sed quam sollicitudin condimentum et eu neque. Nunc enim urna, ultricies ac mollis pretium, imperdiet hendrerit massa. Sed eleifend felis sed tellus cursus lacinia. Aenean venenatis aliquet euismod. Nam quis turpis tellus, vitae malesuada neque.

This is a headline.

This is a subheadline.

Use <p class="gkHeadling">for headline</p>.Use <p class="gkSubHeadline">for subheadline</p>.Proin urna erat, egestas vel consectetur at, accumsan at purus. Donec est risus, facilisis dignissim placerat nec, euismod lacinia nisi. Nam ac sem sed quam sollicitudin condimentum et eu neque. Nunc enim urna, ultricies ac mollis pretium, imperdiet hendrerit massa. Sed eleifend felis sed tellus cursus lacinia. Aenean venenatis aliquet euismod. Nam quis turpis tellus, vitae malesuada neque.

This is a small headline

This is a large headline

Use <p class="gkHeadling">for headline</p>.Use <p class="gkSubHeadline">for subheadline</p>.Proin urna erat, egestas vel consectetur at, accumsan at purus. Donec est risus, facilisis dignissim placerat nec, euismod lacinia nisi. Nam ac sem sed quam sollicitudin condimentum et eu neque. Nunc enim urna, ultricies ac mollis pretium, imperdiet hendrerit massa. Sed eleifend felis sed tellus cursus lacinia. Aenean venenatis aliquet euismod. Nam quis turpis tellus, vitae malesuada neque.

Icon set 1

This is a sample audio message. Use <p class="gkAudio">Your audio message goes here!</p>.

This is a sample webcam message. Use <p class="gkWebcam">Your webcam goes here!</p>.

This is a sample email message. Use <p class="gkEmail">Your email message goes here!</p>.

This is a sample creditcard message. Use <p class="gkCreditcard">Your creditcart message goes here!</p>.

This is a sample feed message. Use <p class="gkFeed">Your feed goes here!</p>.

This is a sample help message. Use <p class="gkHelp">Your help message goes here!</p>.

This is a sample images message. Use <p class="gkImages">Your images message goes here!</p>.

This is a sample lock message. Use <p class="gkLock">Your webcam goes here!</p>.

This is a sample printer message. Use <p class="gkPrinter">Your printer message goes here!</p>.

This is a sample report message. Use <p class="gkReport">Your report message goes here!</p>.

This is a sample script message. Use <p class="gkScript">Your script goes here!</p>.

This is a sample time message. Use <p class="gkTime">Your time message goes here!</p>.

This is a sample user message. Use <p class="gkUser">Your user message goes here!</p>.

This is a sample world message. Use <p class="gkWorld">Your world goes here!</p>.

This is a sample cart message. Use <p class="gkCart">Your cart message goes here!</p>.

This is a sample cd message. Use <p class="gkCd">Your cd message goes here!</p>.

This is a sample chart_bar message. Use <p class="gkChartBar">Your chart_bar goes here!</p>.

This is a sample chart_line message. Use <p class="gkChartLine">Your chart_line message goes here!</p>.

This is a sample chart_pie message. Use <p class="gkChartPie">Your chart_pie message goes here!</p>.

This is a sample clock message. Use <p class="gkClock">Your clock goes here!</p>.

This is a sample cog message. Use <p class="gkCog">Your cog message goes here!</p>.

This is a sample coins message. Use <p class="gkCoins">Your coins message goes here!</p>.

This is a sample compress message. Use <p class="gkCompress">Your compress goes here!</p>.

This is a sample computer message. Use <p class="gkComputer">Your computer message goes here!</p>.

This is a sample cross message. Use <p class="gkCross">Your cross message goes here!</p>.

This is a sample disk message. Use <p class="gkDisk">Your disk goes here!</p>.

This is a sample error message. Use <p class="gkError">Your error message goes here!</p>.

This is a sample exclamation message. Use <p class="gkExclamation">Your exclamation message goes here!</p>.

This is a sample film message. Use <p class="gkFilm">Your film goes here!</p>.

This is a sample folder message. Use <p class="gkFolder">Your folder message goes here!</p>.

This is a sample group message. Use <p class="gkGroup">Your group message goes here!</p>.

This is a sample heart message. Use <p class="gkHeart">Your heart goes here!</p>.

This is a sample house message. Use <p class="gkHouse">Your house message goes here!</p>.

This is a sample image message. Use <p class="gkImage">Your image message goes here!</p>.

This is a sample information message. Use <p class="gkInformation">Your information message goes here!</p>.

This is a sample magnifier message. Use <p class="gkMagnifier">Your magnifier message goes here!</p>.

This is a sample money message. Use <p class="gkMoney">Your money goes here!</p>.

This is a sample new message. Use <p class="gkNew">Your new message goes here!</p>.

This is a sample note message. Use <p class="gkNote">Your note message goes here!</p>.

This is a sample page message. Use <p class="gkPage">Your page goes here!</p>.

This is a sample page_white message. Use <p class="gkPage_white">Your page_white message goes here!</p>.

This is a sample plugin message. Use <p class="gkPlugin">Your plugin message goes here!</p>.

This is a sample accept message. Use <p class="gkAccept">Your accept goes here!</p>.

This is a sample add message. Use <p class="gkAdd">Your add message goes here!</p>.

This is a sample camera message. Use <p class="gkCamera">Your camera message goes here!</p>.

This is a sample brick message. Use <p class="gkBrick">Your brick goes here!</p>.

This is a sample box message. Use <p class="gkBox">Your box message goes here!</p>.

This is a sample calendar message. Use <p class="gkCalendar">Your calendar message goes here!</p>.

Icon set 2

This is a sample audio message. Use <p class="gkAudioIs2">Your audio message goes here!</p>.

This is a sample email message. Use <p class="gkEmailIs2">Your email message goes here!</p>.

This is a sample feed message. Use <p class="gkFeedIs2">Your feed message goes here!</p>.

This is a sample images message. Use <p class="gkImagesIs2">Your images message goes here!</p>.

This is a sample lock message. Use <p class="gkLockIs2">Your lock message goes here!</p>.

This is a sample printer message. Use <p class="gkPrinterIs2">Your printer message goes here!</p>.

This is a sample time message. Use <p class="gkTimeIs2">Your time message goes here!</p>.

This is a sample user message. Use <p class="gkUserIs2">Your calendar message goes here!</p>.

This is a sample world message. Use <p class="gkWorldIs2">Your world message goes here!</p>.

YThis is a sample cart message. Use <p class="gkCartIs2">Your cart message goes here!</p>.

This is a sample cd message. Use <p class="gkCdIs2">Your cd message goes here!</p>.

This is a sample chart line message. Use <p class="gkChartLineIs2">Your chart line message goes here!</p>.

This is a sample chart pie message. Use <p class="gkChartPieIs2">Your calendar message goes here!</p>.

This is a sample clock message. Use <p class="gkClockIs2">Your clock message goes here!</p>.

This is a sample config message. Use <p class="gkCogIs2">Your config message goes here!</p>.

This is a sample computer message. Use <p class="gkComputerIs2">Your computer message goes here!</p>.

This is a sample error message. Use <p class="gkErrorIs2">Your error message goes here!</p>.

This is a sample exclamation message. Use <p class="gkExclamationIs2">Your exclamation message goes here!</p>.

This is a sample movie message. Use <p class="gkFilmIs2">Your movie message goes here!</p>.

This is a sample folder message. Use <p class="gkFolderIs2">Your folder message goes here!</p>.

This is a group calendar message. Use <p class="gkGroupIs2">Your group message goes here!</p>.

This is a sample house message. Use <p class="gkHouseIs2">Your house message goes here!</p>.

This is a sample image message. Use <p class="gkImageIs2">Your image message goes here!</p>.

This is a sample information message. Use <p class="gkInfromationIs2">Your information message goes here!</p>.

This is a sample magnifier message. Use <p class="gkMagnifierIs2">Your magnifier message goes here!</p>.

This is a sample money message. Use <p class="gkMoneyIs2">Your money message goes here!</p>.

This is a sample page message. Use <p class="gkPageIs2">Your page message goes here!</p>.

This is a sample camera message. Use <p class="gkCameraIs2">Your camera message goes here!</p>.

This is a calendar feed message. Use <p class="gkCalendarIs2">Your calendar message goes here!</p>.

This is a sample contact message. Use <p class="gkContactIs2">Your contact message goes here!</p>.

This is a sample facebook message. Use <p class="gkFacebookIs2">Your facebook message goes here!</p>.

This is a sample like it message. Use <p class="gkLikeItIs2">Your like it message goes here!</p>.

This is a sample twitter message. Use <p class="gkTwitterIs2">Your twitter message goes here!</p>.

This is a sample video message. Use <p class="gkVideoIs2">Your video message goes here!</p>.

This is a sample youtube message. Use <p class="gkYoutubeIs2">Your youtube message goes here!</p>.

Icon set 3

This is a sample audio message. Use <p class="gkAudioIs3">Your audio message goes here!</p>.

This is a sample camera message. Use <p class="gkCameraIs3">Your camera message goes here!</p>.

This is a sample lock message. Use <p class="gkLockIs3">Your lock message goes here!</p>.

This is a sample user message. Use <p class="gkUserIs3">Your user message goes here!</p>.

This is a sample cart message. Use <p class="gkCartIs3">Your cart message goes here!</p>.

This is a sample chart bar message. Use <p class="gkChartBarIs3">Your chart bar message goes here!</p>.

This is a sample config message. Use <p class="gkConfigIs3">Your config message goes here!</p>.

This is a sample configuration message. Use <p class="gkConfig2Is3">Your configuration message goes here!</p>.

This is a sample computer message. Use <p class="gkComputerIs3">Your computer message goes here!</p>.

This is a sample coffe message. Use <p class="gkCoffeIs3">Your coffe message goes here!</p>.

This is a sample cross message. Use <p class="gkCrossIs3">Your cross message goes here!</p>.

This is a sample error message. Use <p class="gkErrorIs3">Your error message goes here!</p>.

This is a sample house message. Use <p class="gkHouseIs3">Your house message goes here!</p>.

This is a sample information message. Use <p class="gkInformationIs3">Your inforation message goes here!</p>.

This is a sample magnifier message. Use <p class="gkMagnifierIs3">Your magnifier message goes here!</p>.

This is a sample page message. Use <p class="gkPageIs3">Your page message goes here!</p>.

This is a sample lock message. Use <p class="gkLockIs3">Your lock message goes here!</p>.

This is a sample camera message. Use <p class="gkCameraIs3">Your camera message goes here!</p>.

This is a sample star message. Use <p class="gkStarIs3">Your star message goes here!</p>.

This is a sample telephone message. Use <p class="gkTelephoneIs3">Your telephone message goes here!</p>.

Tooltips

Here are some examples of a ClassicThis is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own!, CriticalCriticalThis is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own!, HelpHelpThis is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own!, InformationInformationThis is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own! and WarningWarningThis is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own! CSS powered tooltip. This is just an example of what you can do so feel free to get creative and produce your own!

Highlights

This is a highlight phrase. Use <span class="gkHighlight1">Your highlight phrase goes here!</span>.

This is a highlight phrase. Use <span class="gkHighlight2">Your highlight phrase goes here!</span>.

This is a highlight phrase. Use <span class="gkHighlight3">Your highlight phrase goes here!</span>.

This is a highlight phrase. Use <span class="gkHighlight4">Your highlight phrase goes here!</span>.

Code

Below is a sample of <pre> or <div class="gkCode1">

#wrapper {
position: relative;
float: left;
display: block;
}

Below is a sample of <div class="gkCode2">

#wrapper {
position: relative;
float: left;
display: block;
}

Below is a sample of <div class="gkCode3"><h4>Name of your file</h4>Here goes your code</div>



File

#wrapper {
position: relative;
float: left;
display: block;
}

Unordered lists

Types of unordered lists

<ul class="gkBullet1">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkBullet2">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkBullet3">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkBullet4">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkCircle1">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkCircle2">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkSquare1">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkSquare2">

  • Element 1
  • Element 2
  • Element 3

<ul class="gkSquare3">

  • Element 1
  • Element 2
  • Element 3

Ordered lists

Types of ordered list:

<ol class="gkRoman">

  1. Element
  2. Element
  3. Element
  4. Element

<ol class="gkDec">

  1. Element
  2. Element
  3. Element
  4. Element

<ol class="gkAlpha">

  1. Element
  2. Element
  3. Element
  4. Element

<ol class="gkDecimalLeadingZero">

  1. Element
  2. Element
  3. Element
  4. Element

<div class="gkNumber1"><p><span>here goes a number</span>and here text of element</p>

01 Element

02 Element

<div class="gkNumber2"><p><span>here goes a number</span>and here text of element</p>

01 Element

02 Element

Abbrs and acronyms

This is a sample of an abbreviation Dr. Use <abbr title="Here goes full word or phrase">here goes an abbreviation</abbr>

This is a sample of an acronym NATO. Use <acronym title="Here goes full phrase">here goes an acronym</abbr>

Definition lists

Below are samples of definition lists

<dl class="gkDef1"><dt>Here goes the word you're about to define</dt><dd>Here goes definition</dd></dl>

Butter
it is a dairy product made by churning fresh or fermented cream or milk. It is generally used as a spread and a condiment, as well as in cooking applications such as baking, sauce making, and frying. Butter consists of butterfat, water and milk proteins.
Dairy milk
is an opaque white liquid produced by the mammary glands of mammals (including monotremes). It provides the primary source of nutrition for newborn mammals before they are able to digest other types of food.

<dl class="gkDef2"><dt>Here goes the word you're about to define</dt><dd>Here goes definition</dd></dl>

Butter
it is a dairy product made by churning fresh or fermented cream or milk. It is generally used as a spread and a condiment, as well as in cooking applications such as baking, sauce making, and frying. Butter consists of butterfat, water and milk proteins.
Dairy milk
is an opaque white liquid produced by the mammary glands of mammals (including monotremes). It provides the primary source of nutrition for newborn mammals before they are able to digest other types of food.

<dl class="gkDef3"><dt>Here goes the word you're about to define</dt><dd>Here goes definition</dd></dl>

Butter
it is a dairy product made by churning fresh or fermented cream or milk. It is generally used as a spread and a condiment, as well as in cooking applications such as baking, sauce making, and frying. Butter consists of butterfat, water and milk proteins.
Dairy milk
is an opaque white liquid produced by the mammary glands of mammals (including monotremes). It provides the primary source of nutrition for newborn mammals before they are able to digest other types of food.

Legends

Legend

This is a sample legend note. Use <div class="gkLegend1"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Legend

This is a sample legend note. Use <div class="gkLegend2"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Legend

This is a sample legend note. Use <div class="gkLegend3"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Legend

This is a sample legend note. Use <div class="gkLegend4"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Legend

This is a sample legend note. Use <div class="gkLegend5"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Legend

This is a sample legend note. Use <div class="gkLegend6"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Legend

This is a sample legend note. Use <div class="gkLegend7"> <h4> Title </h4> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div>.

Dropcaps

This is a sample text with Dropcap. Use <p> <span class="gkDropcap1">t</span> to make the first letter larger. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue. Duis quis quam sed purus porta eleifend. Vivamus ullamcorper est id libero aliquam ullamcorper. Donec eget dignissim augue. Donec ante felis, aliquam ut consequat eget, lobortis dapibus risus. Aliquam laoreet enim et lectus ornare hendrerit. Aliquam rhoncus enim libero. Morbi aliquam, nibh mattis feugiat dapibus, nisi massa adipiscing justo, sit amet condimentum urna ipsum et lacus. Nam fermentum, eros quis ullamcorper convallis, libero mauris lacinia eros, sed tempus leo lorem vitae purus. Nunc a malesuada felis. Cras ultrices sapien eu nisi elementum non blandit urna sodales. Duis accumsan cursus massa, eu facilisis diam porta ut..</p>.

This is a sample text with Dropcap. Use <p> <span class="gkDropcap2">t</span> to make the first letter larger. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue. Duis quis quam sed purus porta eleifend. Vivamus ullamcorper est id libero aliquam ullamcorper. Donec eget dignissim augue. Donec ante felis, aliquam ut consequat eget, lobortis dapibus risus. Aliquam laoreet enim et lectus ornare hendrerit. Aliquam rhoncus enim libero. Morbi aliquam, nibh mattis feugiat dapibus, nisi massa adipiscing justo, sit amet condimentum urna ipsum et lacus. Nam fermentum, eros quis ullamcorper convallis, libero mauris lacinia eros, sed tempus leo lorem vitae purus. Nunc a malesuada felis. Cras ultrices sapien eu nisi elementum non blandit urna sodales. Duis accumsan cursus massa, eu facilisis diam porta ut..</p>.

This is a sample text with Dropcap. Use <p class="gkDropcap3"> <span class="gkDropcap3">t</span> to make the first letter larger. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue. Duis quis quam sed purus porta eleifend. Vivamus ullamcorper est id libero aliquam ullamcorper. Donec eget dignissim augue. Donec ante felis, aliquam ut consequat eget, lobortis dapibus risus. Aliquam laoreet enim et lectus ornare hendrerit. Aliquam rhoncus enim libero. Morbi aliquam, nibh mattis feugiat dapibus, nisi massa adipiscing justo, sit amet condimentum urna ipsum et lacus. Nam fermentum, eros quis ullamcorper convallis, libero mauris lacinia eros, sed tempus leo lorem vitae purus. Nunc a malesuada felis. Cras ultrices sapien eu nisi elementum non blandit urna sodales. Duis accumsan cursus massa, eu facilisis diam porta ut..</p>.

Floated blocks

Below are samples of text in which part of it is displayed in a separate block

<p> Here goes main part of the text <span class="gkBlockTextLeft">Block of text</span>rest of the text</p>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue. Duis quis quam sed purus porta eleifend.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue.Donec eget dignissim augue. Donec ante felis, aliquam ut consequat eget, lobortis dapibus risus. Aliquam laoreet enim et lectus ornare hendrerit. Aliquam rhoncus enim libero. Morbi aliquam, nibh mattis feugiat dapibus, nisi massa adipiscing justo, sit amet condimentum urna ipsum et lacus. Nam fermentum, eros quis ullamcorper convallis, libero mauris lacinia eros, sed tempus leo lorem vitae purus. Nunc a malesuada felis. Cras ultrices sapien eu nisi elementum non blandit urna sodales. Duis accumsan cursus massa, eu facilisis diam porta ut. Morbi cursus est vel velit hendrerit dictum.

<p> Here goes main part of the text <span class="gkBlockTextRight">Block of text</span>rest of the text</p>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue. Duis quis quam sed purus porta eleifend.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue.Donec eget dignissim augue. Donec ante felis, aliquam ut consequat eget, lobortis dapibus risus. Aliquam laoreet enim et lectus ornare hendrerit. Aliquam rhoncus enim libero. Morbi aliquam, nibh mattis feugiat dapibus, nisi massa adipiscing justo, sit amet condimentum urna ipsum et lacus. Nam fermentum, eros quis ullamcorper convallis, libero mauris lacinia eros, sed tempus leo lorem vitae purus. Nunc a malesuada felis. Cras ultrices sapien eu nisi elementum non blandit urna sodales. Duis accumsan cursus massa, eu facilisis diam porta ut. Morbi cursus est vel velit hendrerit dictum.

<p> Here goes main part of the text <span class="gkBlockTextCenter">Block of text</span>rest of the text</p>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue. Duis quis quam sed purus porta eleifend.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum condimentum pulvinar justo, sed faucibus ligula feugiat ac. Morbi quis enim nulla, vel congue augue.Donec eget dignissim augue. Donec ante felis, aliquam ut consequat eget, lobortis dapibus risus. Aliquam laoreet enim et lectus ornare hendrerit. Aliquam rhoncus enim libero. Morbi aliquam, nibh mattis feugiat dapibus, nisi massa adipiscing justo, sit amet condimentum urna ipsum et lacus. Nam fermentum, eros quis ullamcorper convallis, libero mauris lacinia eros, sed tempus leo lorem vitae purus. Nunc a malesuada felis. Cras ultrices sapien eu nisi elementum non blandit urna sodales. Duis accumsan cursus massa, eu facilisis diam porta ut. Morbi cursus est vel velit hendrerit dictum.

Other span blocks

This is a sample pin note. Use <span class="gkClear">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkClear-1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkClear-2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-3">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-4">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-5">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-6">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

This is a sample pin note. Use <span class="gkColor-7">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer urna. Aenean tristique. Fusce a neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </span>

Blockquotes

This is a sample quote text. Use < blockquote > Your quoted text goes here!< /blockquote >
This is a sample quote text. Use< blockquote><div class="gkBlockquote1"><div> Your quoted text goes here!< /div>< /div>< /blockquote >
This is a sample quote text. Use< blockquote><div class="gkBlockquote2"><div> Your quoted text goes here!< /div>< /div>< /blockquote >
This is a sample quote text. Use< blockquote><div class="gkBlockquote3"><div> Your quoted text goes here!< /div>< /div>< /blockquote >
This is a sample quote text. Use< blockquote><div class="gkBlockquote4"><div> Your quoted text goes here!< /div>< /div>< /blockquote >

Tables

Table Header (thead)
Table Footer (tfoot)
Column 1 Column 2
Cell 3 - part of tbody Cell 4 - part of tbody
Cell 5 - part of tbody Cell 6 - part of tbody
Cell 7 - part of tbody Cell 8 - part of tbody

Table Header (thead)
Table Footer (tfoot)
Column 1 Column 2
Cell 1 - part of tbody Cell 2 - part of tbody
Cell 3 - part of tbody Cell 4 - part of tbody
Cell 5 - part of tbody Cell 6 - part of tbody

 

 

Template additional styles

In order to get the video you have to use code like this:


<a class="gk_video_frame" href="http://www.vimeo.com/16274294" rel="mediabox[720 410]">
    <img src="/images/stories/demo/demo_video_1.png" border="0" alt="Video 1" />
    <span class="gk_vframe">Frame</span> 
    <span class="gk_voverlay">Overlay</span> 
    Watch the video 
</a>

As a href attribute you set the video address. In the rel attribute you can specify the video size. Image element is the thumbnail in the frame.

You can also create a blocks with icons. The structure is always similar - you have to change only second class near gk_block:


<div class="gk_block tablet">
<h3><a href="#">Mobile Ready</a></h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum</p>
</div>

Available blocks styles with classes:

android

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

blackberry

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

calendar

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

chat

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

clock

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

cog

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

firefox

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

info

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

mac

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

mail

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

mobilephone

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

phone

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

recycledbag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

shoppingcart

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

tablet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

user

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis erat elit. Donec pretium condimentum

Published in Blogs
Read more...
Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. This plugin is required in order to use the recital eclipse workspace.
Published in Blogs
Read more...

SE Linux is a feature of the Linux kernel that provides mandatory access control. This policy based access control system grants far greater control over the resources on a machine than standard Linux access controls such as permissions.

Many modern Linux distributions are shipping with SELinux enabled by default, Fedora 14 and Rhel 6 both install with it enabled.

When you run Recital Web on a SELinux enabled machine and navigate to the default.rsp page you will see something similar to the screen shot below.

1
If you launch the SELinux troubleshooter you will see the following problem.

SELinux is blocking the apache server from accessing the Recital server running on port 8001.

2
To manage you SELinux policy you must have the policycoreutils package group installed. The policycoreutils contains the policy core utilities that are required for basic operation of a SELinux system.

If you wish to use a GUI tool, you must install the policycoreutils-gui package.

At the command prompt execute the following:

As root

$ yum install policycoreutils

$ semanage port -a -t http_port_t -p tcp 8001

$ service recital restart

$ service httpd restart 
 

We use the semanage command here to allow the http server access to port 8001. Once you have completed the steps detailed above you can go and navigate back to the default.rsp page in your borwser, where you will find the permission denied message is now replaced by the default.rsp page.


4
SELinux does a great job of restricting services and daemons so rather than simply disabling it, why not work with it!

When it comes to security, every little bit helps...

Published in Blogs
Read more...
Occasionally subversion can get itself confused about what is and what is not in a working copy. This usually occurs if you have replaced the contents of a directory such as when you upgrade a component in Joomla!

You receive a message such containing this:

"working copy admin area is missing"

How to resolve this: 

Step 1 -- Rename the directory that is causing the error from a shell prompt and prefix it with __ 

mv com_docman __com_docman

Step 2 -- Using your subversion client refresh your working copy, then "update" the directory that is causing the problem e.g. update com_docman.

Step 3 -- Now you can commit the __com_docman directory.

After you have done this follow these steps, using your subversion client:

Step 4 -- delete the com_docman directory from your working copy
Step 5 -- rename __com_docman back to com_docman

Now "commit all" and both your working copy and repository will be in sync.
Published in Blogs
Read more...
Each Recital table can have one or more data dictionaries to provide a central repository for constraints and other metadata. 

Here's how to set up field validation for a field with a small static number of acceptable values.

Using the example.dbf table from the southwind sample database, validation can be added to the title field to ensure it matches one of a list values.
open database southwind
alter table example add constraint;
(title set check inlist(alltrim(title),"Miss","Mr","Mrs","Ms"))
The inlist() function checks whether the specified expression exists in the comma-separated list which follows.  An attempt to update title with a value not in the list will give an error: Validation on field 'TITLE' failed.

If you have access to the Recital Workbench, you can use the modify structure worksurface to add and alter your dictionary entries, including a customized error message if required.

validation


Published in Blogs
Read more...
Recital 10 introduced the DIE( )and EXIT( ) functions. These functions operates in the same way as the PHP DIE( ) and EXIT( ) functions. They output a message and terminate the current session in both Recital and Recital Web.
try
  open database southwind
catch
  die("Cannot open database, please try later.")
endtry
Published in Blogs
Read more...
Recital 10 introduced the ECHO command. This command operates in the same way as the PHP ECHO command. It does not append a newline to the output but rather operates in the same way as the existing ?? command in Recital. The string being output can contain C-style string escapes \n \t or \r (newline, tab and carriage return respectively) e.g.
echo "Hello world\n"
Published in Blogs
Read more...

DRBD:
DRBD (Distributed Replicated Block Device) forms the storage redundancy portition of a HA cluster setup. Explained in basic terms DRBD provides a means of achieving RAID 1 behavoir over a network, where whole block devices are mirrored accross the network.

To start off you will need 2 indentically sized raw drives or partitions. Many how-to's on the internet assume the use of whole drives, of course this will be better performance, but if you are simply getting familar with the technology you can repartition existing drives to allow for two eqaully sized raw partitions, one on each of the systems you will be using.

There are 3 DRBD replication modes:
• Protocol A: Write I/O is reported as completed as soon as it reached local disk and local TCP send buffer
• Protocol B: Write I/O is reported as completed as soon as it reached local disk and remote TCP buffer cache
• Protocol C: Write I/O is reported as completed as soon as it reached both local and remote disks.

If we were installing the HA cluster on a slow LAN or if the geogrphical seperation of the systems involved was great, then I recommend you opt for asyncronous mirroring (Protocol A) where the notifcation of a completed write operation occurs as soon as the local disk write is performed. This will greatly improve performance.

As we are setting up our HA cluster connected via a fast LAN, we will be using DRBD in fully syncronous mode, protocol C.
Protocol C involves the file system on the active node only being notified that the write operation was finished when the block is written to both disks of the cluster. Protocol C is the most commonly used mode of DRBD.

/etc/drbd.conf

global { usage-count yes; }
common { syncer { rate 10M; } }
resource r0 {
protocol C;
net {
max-buffers 2048;
ko-count 4;
}
on bailey {
device    /dev/drbd0;
disk      /dev/sda4;
address   192.168.1.125:7789;
meta-disk internal;
}
on giskard {
device    /dev/drbd0;
disk      /dev/sda3;
address   192.168.1.127:7789;
meta-disk internal;
}
}

drbd.conf explained:

Global section, usage-count. The DRBD project keeps statistics about the usage of DRBD versions. They do this by contacting a HTTP server each time a new DRBD version is installed on a system. This can be disabled by setting usage-count no;.

The common seciton contains configurations inhereted by all resources defined.
Setting the syncronisation rate, this is accoimplished by going to the syncer section and then assigning a value to the rate setting. The syncronisation rate refers to rate in which the data is being mirrored in the background. The best setting for the syncronsation rate is related to the speed of the network with which the DRBD systems are communicating on. 100Mbps ethernet supports around 12MBps, Giggabit ethernet somewhere around 125MBps.

in the configuration above, we have a resource defined as r0, the nodes are configured in the "on" host subsections.
"Device" configures the path of the logical block device that will be created by DRBD
"Disk" configures the block device that will be used to store the data.
"Address" configures the IP address and port number of the host that will hold this DRBD device.
"Meta-disk" configures the location where the metadata about the DRBD device will be stored.
You can set this to internal and DRBD will use the physical block device to store the information, by recording the metadata within the last sections of the disk.
Once you have created your configuration file, you must conduct the following steps on both the nodes.

Create device metadata.

$ drbdadm create-md r0
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.
success

Attach the backing device.
$ drbdadm attach r0

Set the syncronisation parameters.
$ drbdadm syncer r0

Connect it to the peer.
$ drbdadm connect r0

Run the service.
$ service drbd start

Heartbeat:

Heartbeat provides the IP redundancy and the service HA functionailty.
On the failure of the primary node the VIP is assigned to the secondary node and the services configured to be HA are started on the secondary node.

Heartbeat configuration:

/etc/ha/ha.conf

## /etc/ha.d/ha.cf on node1
## This configuration is to be the same on both machines
## This example is made for version 2, comment out crm if using version 1
// replace the node variables with the names of your nodes.

crm no
keepalive 1
deadtime 5
warntime 3
initdead 20
bcast eth0
auto_failback yes
node bailey
node giskard

/etc/ha.d/authkeys
// The configuration below set authentication off, and encryption off for the authentication of nodes and their packets.
//Note make sure the authkeys file has the correct permisisions chmod 600

## /etc/ha.d/authkeys
auth 1
1 crc

/etc/ha.d/haresources
//192.168.1.40 is the VIP (Virtual IP) assigned to the cluster.
//the "smb" in the configuration line represents the service we wish to make HA
// /devdrbd0 represents the resource name you configured in the drbd.conf

## /etc/ha.d/haresources
## This configuration is to be the same on both nodes

bailey 192.168.1.40 drbddisk Filesystem::/dev/drbd0::/drbdData::ext3 smb

Published in Blogs
Read more...
Twitter

Copyright © 2022 Recital Software Inc.

Login

Register

User Registration
or Cancel