Taking a Test Drive

Once installed, perform an installation verification to check if the Schema Repository has been correctly installed and is working as expected.

Running a Secure Schema Repository

The following example shows how to start up the Schema Repository using security and three host FTL servers. In production, you would want to run with at least three different servers on three different machines. To learn about FTL server security configuration, components, and capabilities, go to the TIBCO Product Documentation and select the FTL Security document.

Start a Secure FTL Server

Save the following FTL server configuration file as example.yaml and modify file paths for your environment, making sure all directories specified exist:

globals:

core.servers:

srv1: localhost:8585

srv2: localhost:8686

srv3: localhost:8787

tls.secure: pass:admin-pw

auth.url: file:///opt/tibco/ftl/current-version/samples/yaml/auth/users.txt services:

realm:

user: primary

password: primary-pw

persistence:

logfile: /path/to/ftl-server/p-log

data: /path/to/ftl-server/p-data

savedir: /path/to/ftl-server/p-dump

servers:

srv1:

- realm:

data: /path/to/ftl-server/SRV1

- persistence:

name: schema1

logfile: /path/to/ftl-server/SRV1/p-log

data: /path/to/ftl-server/SRV1/p-data

savedir: /path/to/ftl-server/SRV1/p-dump

srv2:

- realm:

data: /path/to/ftl-server/SRV2

- persistence:

name: schema2

logfile: /path/to/ftl-server/SRV2/p-log

data: /path/to/ftl-server/SRV2/p-data

savedir: /path/to/ftl-server/SRV2/p-dump

srv3:

- realm:

data: /path/to/ftl-server/SRV3

- persistence:

name: schema3

logfile: /path/to/ftl-server/SRV3/p-log

data: /path/to/ftl-server/SRV3/p-data

savedir: /path/to/ftl-server/SRV3/p-dump

Initialize Security

Create FTL Server TLS certificates and copy them to each server data directory:

$ /opt/tibco/ftl/current-version/bin/tibftlserver -n srv1 -c /path/to/example.yaml --init-

$ cp /path/to/ftl-server/SRV1/ftl-t* /path/to/ftl-server/SRV2/

$ cp /path/to/ftl-server/SRV1/ftl-t* /path/to/ftl-server/SRV3/

Start Three Secure FTL Server Instances

$ /opt/tibco/ftl/current-version/bin/tibftlserver -n srv1 -c /path/to/example.yaml

$ /opt/tibco/ftl/current-version/bin/tibftlserver -n srv2 -c /path/to/example.yaml

$ /opt/tibco/ftl/current-version/bin/tibftlserver -n srv3 -c /path/to/example.yaml

Start Several Secure tibschemad Instances

Important: macOS sers need to set the following environment variable:

DYLD_LIBRARY_PATH=/opt/tibco/ftl/current-version/lib

Specify your schema HTTPS FTL server URL, specify the trust files, and specify the password and user name. This will start tibschemad with an HTTPS access port. The Schema Repository uses an FTL server for back-end storage so tibschemad must use an account with admin privileges in the FTL server to write to the server.


cd /opt/tibco/akd/repo

bin/tibschemad -ftl 'https://localhost:8585|https://localhost:8686|https://localhost:8787' -trust-file /path/to/ftl-server/srv1/ftl-trust.pem -u admin -p pass:admin-pw -l localhost:9595 &

bin/tibschemad -ftl

'https://localhost:8585|https://localhost:8686|https://localhost:8787' -trust-file /path/to/ftl-server/srv1/ftl-trust.pem -u admin -p pass:admin-pw -l localhost:9696

View the First tibschemad Instance Report

You can see where tibschemad is listening. The first tibschemad instance that registers displays Registered with realm server followed by a list of all the realm servers with which it is registered.

tibschemad: 2020/08/21 11:28:57.121669 info: Using realm server

https://localhost:8585

tibschemad: 2020/08/21 11:28:57.211778 info: tibschemad listening at

https://localhost:9595/

tibschemad: 2020/08/21 11:28:59.216667 info: Registered with realm

server https://localhost:8585, redirecting to

https://localhost:9595/schema/v1

tibschemad: 2020/08/21 11:28:59.283076 info: Registered with realm

server https://localhost:8686, redirecting to

https://localhost:9595/schema/v1

tibschemad: 2020/08/21 11:28:59.290317 info: Registered with realm

server https://localhost:8787, redirecting to

https://localhost:9595/schema/v1

View the Subsequent tibschemad Instance Reports

A subsequent instance of tibschemad reports listening only but does not report Registered with realm server. The instance is in warm standby mode. If the first instance stops, the next subsequent instance registers with the realm server.

tibschemad: 2020/08/21 11:30:09.110311 info: Using realm server

https://localhost:8585

tibschemad: 2020/08/21 11:30:09.334540 info: tibschemad listening at

https://localhost:9696/

Troubleshooting Tip

The following error from tibschemad typically indicates that the username/password is wrong or not specified. Or, the error might mean that the account you are using does not have administrative privileges.

tibschemad: 2021/01/14 12:55:35.119238 fatal: Error fetching

certificate from FTL Realm Server

tibschemad: 2021/01/14 12:55:35.119250 fatal: malformed server

certificate request reply: 1

Verify if tibschemmd Is Up and Running

curl -X GET "https://localhost:9595/schema/v1/config" -H "accept: application/json"

output->{"compatibilityLevel":"BACKWARD"}

Setup Required to Run the Test Apps

The following export statement must be set up for using the test apps:

For details on the test apps, see the User Guide, Using Test Apps.

export CLASSPATH=/opt/tibco/akd/core/libs/kafka-clients-2.7.1.jar:/opt/tibco/akd/core/libs/log4j-1.2.17.jar:/opt/tibco/akd/core/libs/slf4j-api-1.7.30.jar:/opt/tibco/akd/repo/lib/tibftl-kafka-avro-1.4.0.jar

Sample Execution of AvroConsumer/AvroProducer Test Apps

Use the following steps to run an AvroConsumer/AvroProducer test app.

  1. Start the FTL Server.

cd /opt/tibco/ftl/<current-version>/samples

source setup

scripts/ftlstart srv1@localhost:13131

  1. Start the Schema Repository.

cd /opt/tibco/akd/repo

bin/tibschemad -ftl http://localhost:13131

  1. Start Zookeeper.

cd /opt/tibco/akd/core/bin/

./zookeeper-server-start.sh /opt/tibco/akd/core/config/zookeeper.properties

  1. Start the Kafka broker.

cd /opt/tibco/akd/core/bin/

./kafka-server-start.sh /opt/tibco/akd/core/config/server.properties

  1. Start AvroConsumer.


java com.tibco.messaging.kafka.samples.AvroConsumer

Subscribed to topic 'AvroHelloWorld', waiting for messages.

Received a message: {"My_String": "Hello world!", "My_Long": 0}

Received a message: {"My_String": "Hello world!", "My_Long": 1}

Received a message: {"My_String": "Hello world!", "My_Long": 2}

Received a message: {"My_String": "Hello world!", "My_Long": 3}

  1. Start AvroProducer.


java com.tibco.messaging.kafka.samples.AvroProducer

Publishing to topic 'AvroHelloWorld'.

Sent a message: {"My_String": "Hello world!", "My_Long": 0}

Sent a message: {"My_String": "Hello world!", "My_Long": 1}

Sent a message: {"My_String": "Hello world!", "My_Long": 2}

Sent a message: {"My_String": "Hello world!", "My_Long": 3}

^C

Exiting after sending 4 Avro messages. Goodbye!

Running a TibConsumer/TibProducer Test

  1. Start the FTL Server.

cd /opt/tibco/ftl/<current-version>/samples

source setup

scripts/ftlstart srv1@localhost:13131

  1. Start the Schema Repository.

cd /opt/tibco/akd/repo

bin/tibschemad -ftl http://localhost:13131

  1. Start Zookeeper.

cd /opt/tibco/akd/core/bin/

./zookeeper-server-start.sh /opt/tibco/akd/core/config/zookeeper.properties

  1. Start the Kafka broker.

cd /opt/tibco/akd/core/bin/

./kafka-server-start.sh /opt/tibco/akd/core/config/server.properties

  1. Start the TibConsumer test app.

java com.tibco.messaging.kafka.samples.TibConsumer -rs http://localhost:13131 -c 1 -t avro-messages

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder

for further details.

<TEST FULLY STARTED>

  1. Start the TibProducer test app.

java com.tibco.messaging.kafka.samples.TibProducer -rs http://localhost:13131 -c 1 -t avro-messages

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder

for further details.

sending messages ...

Sent message[0]: {"My_Long": 0, "My_String": "message-0", "My_Opaque":

{"bytes": "Bytes!"}}

  1. Verify the message was received by TibConsumer.
    As shown below, the consumer received one test message.

Got a message: {"My_Long": 0, "My_String": "message-0", "My_Opaque":

{"bytes": "Bytes!"}}