Code Monkey home page Code Monkey logo

ignite-go-client's Introduction

ignite-go-client

GoDoc GitHub release GitHub issues GitHub issues closed Go Report Card license

Apache Ignite (GridGain) v2.5+ client for Go programming language

This library is production ready.

Version is less than v1.0 because not all functionality is implemented yet (see Road map for details). But the implemented functionality is production ready.

Requirements

  • Apache Ignite v2.5+ (because of binary communication protocol is used)
  • go v1.9+

Road map

Project status:

  1. Develop "Cache Configuration" methods (Completed)
  2. Develop "Key-Value Queries" methods (Completed*)
  3. Develop "SQL and Scan Queries" methods (Completed)
  4. Develop SQL driver (Completed)
  5. Develop "Binary Types" methods (Not started)

*Not all types are supported. See type mapping for detail.

How to install

go get -u github.com/amsokol/ignite-go-client/...

How to use client

Import client package:

import (
    "github.com/amsokol/ignite-go-client/binary/v1"
)

Connect to server:

ctx := context.Background()

// connect
c, err := ignite.Connect(ctx, ignite.ConnInfo{
    Network: "tcp",
    Host:    "localhost",
    Port:    10800,
    Major:   1,
    Minor:   1,
    Patch:   0,
    // Credentials are only needed if they're configured in your Ignite server.
    Username: "ignite",
    Password: "ignite",
    Dialer: net.Dialer{
        Timeout: 10 * time.Second,
    },
    // Don't set the TLSConfig if your Ignite server
    // isn't configured with any TLS certificates.
    TLSConfig: &tls.Config{
        // You should only set this to true for testing purposes.
        InsecureSkipVerify: true,
    },
})
if err != nil {
    t.Fatalf("failed connect to server: %v", err)
}
defer c.Close()

See example of Key-Value Queries for more.

See example of SQL Queries for more.

See "_test.go" files for other examples.

How to use SQL driver

Import SQL driver:

import (
    "database/sql"

    _ "github.com/amsokol/ignite-go-client/sql"
)

Connect to server:

ctx := context.Background()

// open connection
db, err := sql.Open("ignite", "tcp://localhost:10800/ExampleDB?version=1.1.0&username=ignite&password=ignite"+
    "&tls=yes&tls-insecure-skip-verify=yes&page-size=10000&timeout=5000")
if err != nil {
    t.Fatalf("failed to open connection: %v", err)
}
defer db.Close()

See example for more.

Connection URL format:

protocol://host:port/cache?param1=value1&param2=value2&paramN=valueN

URL parts:

Name Mandatory Description Default value
protocol no Connection protocol tcp
host no Apache Ignite Cluster host name or IP address 127.0.0.1
port no Max rows to return by query 10800
cache yes Cache name

URL parameters (param1,...paramN):

Name Mandatory Description Default value
schema no Database schema "" (PUBLIC schema is used)
version no Binary protocol version in Semantic Version format 1.0.0
username no Username no
password no Password no
tls no Connect using TLS no
tls-insecure-skip-verify no Controls whether a client verifies the server's certificate chain and host name no
page-size no Query cursor page size 10000
max-rows no Max rows to return by query 0 (looks like it means unlimited)
timeout no Timeout in milliseconds to execute query 0 (disable timeout)
distributed-joins no Distributed joins (yes/no) no
local-query no Local query (yes/no) no
replicated-only no Whether query contains only replicated tables or not (yes/no) no
enforce-join-order no Enforce join order (yes/no) no
collocated no Whether your data is co-located or not (yes/no) no
lazy-query no Lazy query execution (yes/no) no

How to run tests

  1. Download Apache Ignite 2.7 from official site
  2. Extract distributive to any folder
  3. Persistance mode is enabled to run tests. So you need to remove <path_with_ignite>\work folder each time to clean up test data before run tests.
  4. cd to testdata folder with configuration-for-tests.xml file
  5. Start Ignite server with configuration-for-tests.xml configuration file:
# For Windows:
<path_with_ignite>\bin\ignite.bat .\configuration-for-tests.xml

# For Linux:
<path_with_ignite>/bin/ignite.sh ./configuration-for-tests.xml
  1. Activate cluster:
# For Windows:
<path_with_ignite>\bin\control.bat --activate --user ignite --password ignite

# For Linux:
<path_with_ignite>/bin/control.bat --activate --user ignite --password ignite
  1. Run tests into the root folder of this project:
go test ./...

Type mapping

Apache Ignite Type Go language type
byte byte
short int16
int int32
long int64, int
float float32
double float64
char ignite.Char
bool bool
String string
UUID (Guid) uuid.UUID (UUID library from Google)
Date* ignite.Date / time.Time
byte array []byte
short array []int16
int array []int32
long array []int64
float array []float32
double array []float64
char array []ignite.Char
bool array []bool
String array []string
UUID (Guid) array []uuid.UUID
Date array* []ignite.Date / []time.Time
Object array Not supported. Need help.
Collection Not supported. Need help.
Map Not supported. Need help.
Enum Not supported. Need help.
Enum array Not supported. Need help.
Decimal Not supported. Need help.
Decimal array Not supported. Need help.
Timestamp time.Time
Timestamp array []time.Time
Time** ignite.Time / time.Time
Time array** []ignite.Time / []time.Time
NULL nil
Complex Object ignite.ComplexObject

Note: pointers (*byte, *int32, *string, *uuid.UUID, *[]time.Time, etc.) are supported also.

*Date is outdated type. It's recommended to use Timestamp type. If you still need Date type use ignite.ToDate() function when you put date:

t := time.Date(2018, 4, 3, 14, 25, 32, int(time.Millisecond*123), time.UTC)
err := c.CachePut("CacheGet", false, "Date", ignite.ToDate(t)) // ToDate() converts time.Time to ignite.Date
...

t, err = c.CacheGet("CacheGet", false, "Date") // 't' is time.Time, you don't need any converting

**Time is outdated type. It's recommended to use Timestamp type. If you still need Time type use ignite.ToTime() function when you put time:

t := time.Date(1, 1, 1, 14, 25, 32, int(time.Millisecond*123), time.UTC)
err := c.CachePut("CacheGet", false, "Time", ignite.ToTime(t)) // ToTime() converts time.Time to ignite.Time (year, month and day are ignored)
...

t, err = c.CacheGet("CacheGet", false, "Time") // 't' is time.Time (where year=1, month=1 and day=1), you don't need any converting

Example how to use Complex Object type

// put complex object
c1 := ignite.NewComplexObject("ComplexObject1")
c1.Set("field1", "value 1")
c1.Set("field2", int32(2))
c1.Set("field3", true)
c2 := ignite.NewComplexObject("ComplexObject2")
c2.Set("complexField1", c1)
if err := c.CachePut(cache, false, "key", c2); err != nil {
    return err
}
...

// get complex object
v, err := c.CacheGet(cache, false, "key")
if err != nil {
    return err
}
c2 = v.(ignite.ComplexObject)
log.Printf("key=\"%s\", value=\"%#v\"", "key", c2)
v, _ = c2.Get("complexField1")
c1 = v.(ignite.ComplexObject)
log.Printf("key=\"%s\", value=\"%#v\"", "complexField1", c1)
v, _ = c1.Get("field1")
log.Printf("key=\"%s\", value=\"%s\"", "field1", v)
v, _ = c1.Get("field2")
log.Printf("key=\"%s\", value=%d", "field2", v)
v, _ = c1.Get("field3")
log.Printf("key=\"%s\", value=%t", "field3", v)

SQL and Scan Queries supported operations

Operation Status of implementation
OP_QUERY_SQL Done.
OP_QUERY_SQL_CURSOR_GET_PAGE Done.
OP_QUERY_SQL_FIELDS Done.
OP_QUERY_SQL_FIELDS_CURSOR_GET_PAGE Done.
OP_QUERY_SCAN Done (without filter object support).
OP_QUERY_SCAN_CURSOR_GET_PAGE Done (without filter object support).
OP_RESOURCE_CLOSE Done.

Error handling

In case of operation execution error you can get original status and error message from Apache Ignite server.
Example:

if err := client.CachePut("TestCache", false, "key", "value"); err != nil {
    // try to cast to *IgniteError type
    original, ok := err.(*IgniteError)
    if ok {
        // log Apache Ignite status and message
        log.Printf("[%d] %s", original.IgniteStatus, original.IgniteMessage)
    }
    return err
}

ignite-go-client's People

Contributors

aelitastyles avatar philippgille avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ignite-go-client's Issues

Set up continuous integration

I would love to see this repository being automatically go build and go tested with each push and PR.

There are two big advantages:

  1. When changing code (fixing bugs or implementing new features) you currently have to manually start your Ignite test server and run your tests. Maybe when in a hurry you forget to do it and you push code that breaks existing behaviour without noticing it, or maybe even a compile error is introduced. And it's cumbersome for testing PRs.
  2. Contributors currently don't know your server setup. Some contributors like me don't want to install a Java program at all and rather use a simple Docker container that contains all dependencies, runtimes etc. When continuous integration is set up for a repository, it's super easy for contributors to get the exact same tests running in a fork when using the same CI service.

One of the most popular CI services that's free for open source projects is Travis CI. Many open source projects have their CI set up with Travis CI and then include a badge in their README that indicates whether the most recent build was successful, which is useful for the package maintainers and users alike.

I'd like to help with this issue so I set up some basic CI for my fork of this repo and am willing to create a PR to help you with this project. But I need some help with the Ignite server configuration.

Please let me know if you're interested in this as well, then we can go into the details :) .

Will the project be updated?

@amsokol @philippgille @AelitaStyles
Hope all of you are doing well.
Thank you for your time in implementing the Go Client.
It would be great if you continue the project.
Could you please let us know if the client will be updated to support new Apache Ignite versions and completed?

SQL Driver does not recover if ignite is restarted

If ignite is deactivated and then re-activated the sql execution do recover.

However if ignite is killed and restarted sql executes will timeout.

Test case:

  1. Start ignite, and activate ignite, and connect to ignite from the client.
  2. Make a sql query - this succeeds.
  3. Deactivate ignite - make a sql query - this times out as expected.
  4. Reactivate ignite - make a sql query - this succeeds again.
  5. Kill ignite - make a sql query - this times out as expected.
  6. Do step 1 again
  7. Make a sql query - this should succeed - but times out.

So the driver does not recover from disconnects in the case where ignite is restarted. I believe the driver should be resilient to this case.

Thank you

Hello amsokol,

Just wanted to thank you for this amazing client.
May I ask: will it be maintained in the future? Will it be officially integrated into Apache Ignite documentation? I think Go + Ignite is a very exciting combination!

Transaction Support

Hi,
Thanks for the golang client. Please point me to the "Transaction" APIs. For example if I want to do 2 "put"s as part of one transaction.
Thanks

sql query error: Filed to find SQL table for type: family

cache := "mycache"

if err = c.CacheCreateWithName(cache); err != nil {
	fmt.Println("CacheCreate error")
}
defer c.CacheDestroy(cache)

// select data using QuerySQL
r, err := c.QuerySQL(cache, false, ignite.QuerySQLData{
	Table: "family",
	Query:    "SELECT * FROM family",
	PageSize: 100,
})
if err != nil {
	fmt.Println("Query err")
	fmt.Println(err)
}

I see error like this:
Query err
[1] Failed to find SQL table for type: family

But I can use pqignite query successfully.
from pyignite import Client

SELECT_STMT = '''SELECT * FROM family'''

client = Client()
client.connect('127.0.0.1', 10800)

for query in [ SELECT_STMT ]:
print(query)
results = client.sql(query, include_field_names=True)
next(results)
for row in results:
print(row)

client.close()

bug multiple insert / merge?

I may be doing something wrong but this below returns this error: failed to execute query: [1] Failed to execute DML statement [stmt=MERGE INTO PUBLIC.TASK(ID_TASK, ID_HERO, CREATED_AT, UPDATED_AT, TITLE) VALUES (?,?,?,?,?), (?,?,?,?,?), params=[item.id, i113811807988213595940, 2018-12-09T07:25:20.000Z, 2018-12-09T07:25:20.000Z, item.title, item.id2, i113811807988213595940, 2018-12-09T07:25:20.000Z, 2018-12-09T07:25:20.000Z, item.title]]

"ctx := context.Background()
db := ignite.IgniteConnect(ctx)
defer db.Close()

stmtStr := `MERGE INTO PUBLIC.TASK(ID_TASK, ID_HERO, CREATED_AT, UPDATED_AT, TITLE) VALUES (?,?,?,?,?), (?,?,?,?,?)`
args := make([]interface{}, 10)
args[0] = `item.id`
args[1] = `i113811807988213595940`
args[2] = `2018-12-09T07:25:20.000Z`
args[3] = `2018-12-09T07:25:20.000Z`
args[4] = `item.title`
args[5] = `item.id2`
args[6] = `i113811807988213595940`
args[7] = `2018-12-09T07:25:20.000Z`
args[8] = `2018-12-09T07:25:20.000Z`
args[9] = `item.title`

// insert using prepare statement
stmt, err := db.PrepareContext(c, stmtStr)
if err != nil {
	log.Printf("failed to prepare statement: %v", err)
}

_, err = stmt.ExecContext(c, args...)
if err != nil {
	log.Printf("failed sql execute: %v", err)
}"

on the other hand, when we only have one set of arguments, there is no error and the merge works well:
"ctx := context.Background()
db := ignite.IgniteConnect(ctx)
defer db.Close()

stmtStr := `MERGE INTO PUBLIC.TASK(ID_TASK, ID_HERO, CREATED_AT, UPDATED_AT, TITLE) VALUES (?,?,?,?,?)`
args := make([]interface{}, 5)
args[0] = `item.id`
args[1] = `i113811807988213595940`
args[2] = `2018-12-09T07:25:20.000Z`
args[3] = `2018-12-09T07:25:20.000Z`
args[4] = `item.title`

// insert using prepare statement
stmt, err := db.PrepareContext(c, stmtStr)
if err != nil {
	log.Printf("failed to prepare statement: %v", err)
}

_, err = stmt.ExecContext(c, args...)
if err != nil {
	log.Printf("failed sql execute: %v", err)
}

"
any clue? :)

Invalid handshake message

I'm sure the mistake is on my side or the reason is that Ignite version 2.7 is not officially supported yet, but maybe you can help me anyway.

I'm starting Ignite with Docker:

docker run -it --rm --name ignite -e "CONFIG_URI=https://raw.githubusercontent.com/apache/ignite/master/examples/config/example-cache.xml" -p 10800:10800 apacheignite/ignite

I don't want to run the container on the host network as in the example of the official documentation, and I only want to use the key-value functionality, so I only expose port 10800.

The server seems to work, which I tested with the following steps:

  1. I downloaded the binary distribution: apache-ignite-2.7.0-bin.zip and extracted it
  2. Went to C:\path\to\apache-ignite-2.7.0-bin\platforms\dotnet\examples\dotnetcore
  3. The code uses the full client by default (which starts a node), which we don't want, so I changed it to use the thin client. I added the following method to Program.cs:
    private static void MyTest()
    {
        var cfg = new IgniteClientConfiguration
        {
            Host = "127.0.0.1"
        };
    
        using (IIgniteClient client = Ignition.StartClient(cfg))
        {
            try
            {
                client.CreateCache<int, string>("cache");
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex);
            }
            ICacheClient<int, string> cache = client.GetCache<int, string>("cache");
            cache.Put(1, "Hello, World!");
    
            System.Console.WriteLine(cache.Get(1));
        }
    }
    And also called the method at the beginning of the main method.
  4. Execute dotnet run in the terminal.

This works: "Hello, World!" is printed and when executing multiple times the Docker container log contains a message that the cache "cache" already exists. So the connection is clearly working.

But when using the following Go code, it doesn't work:

package main

import (
	"crypto/tls"
	"fmt"
	"net"
	"time"

	"github.com/amsokol/ignite-go-client/binary/v1"
)

func main() {
	fmt.Println("hello world")

	connInfo := ignite.ConnInfo{
		Dialer: net.Dialer{
			Timeout: 2 * time.Second,
		},
		Host:    "localhost",
		Major:   1,
		Minor:   1,
		Network: "tcp",
		Port:    10800,
		TLSConfig: &tls.Config{
			InsecureSkipVerify: true,
		},
		// Go zero values for Username, Password and Patch
	}
	c, err := ignite.Connect(connInfo)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Connected: %v", c.Connected())
}

The output on the client side is:

hello world
panic: failed to open connection: EOF

goroutine 1 [running]:
main.main()
        C:/path/to/go/src/temp/main.go:31 +0x1b1
exit status 2

The output in the Docker container is:

[21:05:15,251][SEVERE][grid-nio-worker-client-listener-1-#30][ClientListenerProcessor] Closing NIO session because of unhandled exception.
class org.apache.ignite.IgniteCheckedException: Invalid handshake message
        at org.apache.ignite.internal.processors.odbc.ClientListenerNioServerBuffer.read(ClientListenerNioServerBuffer.java:115)
        at org.apache.ignite.internal.processors.odbc.ClientListenerBufferedParser.decode(ClientListenerBufferedParser.java:60)
        at org.apache.ignite.internal.processors.odbc.ClientListenerBufferedParser.decode(ClientListenerBufferedParser.java:40)
        at org.apache.ignite.internal.util.nio.GridNioCodecFilter.onMessageReceived(GridNioCodecFilter.java:114)
        at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
        at org.apache.ignite.internal.util.nio.GridNioServer$HeadFilter.onMessageReceived(GridNioServer.java:3553)
        at org.apache.ignite.internal.util.nio.GridNioFilterChain.onMessageReceived(GridNioFilterChain.java:175)
        at org.apache.ignite.internal.util.nio.GridNioServer$ByteBufferNioClientWorker.processRead(GridNioServer.java:1132)
        at org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.processSelectedKeysOptimized(GridNioServer.java:2389)
        at org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.bodyInternal(GridNioServer.java:2156)
        at org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.body(GridNioServer.java:1797)
        at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
        at java.lang.Thread.run(Thread.java:748)

I thought maybe this is because version 2.7 introduced some changes to the handshake, so I started the Docker container for version 2.4.0, but that didn't work at all:

hello world
panic: failed to open connection: tls: DialWithDialer timed out

goroutine 1 [running]:
main.main()
        C:/path/to/go/src/temp/main.go:31 +0x1b1
exit status 2

Am I configuring the ConnInfo wrong? Or is version 2.7 just not working yet? Do you need more info from me? Can I help out somehow?

err1 failed to execute query: [1] 50000: Failed to set schema for DB connection for thread [schema=ignite]

package main

import (
"context"
"database/sql"
"fmt"
_ "github.com/amsokol/ignite-go-client/sql"
)

func query(db *sql.DB) error {
//rows, err := db.Query("SELECT MAKER_ID,CORE_SYM_ID FROM kline WHERE MAKER_ID = '2'")
rows, err := db.QueryContext(context.Background(), "SELECT MAKER_ID,CORE_SYM_ID FROM kline WHERE MAKER_ID = '2'")
if err != nil {
fmt.Println("err1", err)
return err
}
defer rows.Close()

for rows.Next() {
	var col1 string
	var col2 string
	if err := rows.Scan(&col1, &col2); err != nil {
		return err
	}
	fmt.Printf("MAKER_ID: %s, CORE_SYM_ID: %s\n", col1, col2)
}
return rows.Err()

}
func main() {
ctx := context.Background()

// open connection
db, err := sql.Open("ignite", "tcp://localhost:10800/ignite?"+
	"version=1.1.0"+
	//"schema=kline"+
	// Credentials are only needed if they're configured in your Ignite server.
	"&username=ignite"+
	"&password=ignite"+
	// Don't set "tls=yes" if your Ignite server
	// isn't configured with any TLS certificates.
	"&tls=no"+
	// You should only set this to true for testing purposes.
	"&tls-insecure-skip-verify=no"+
	"&page-size=10000"+
	"&timeout=5000")
if err != nil {
	fmt.Printf("failed to open connection: %v", err)
}
defer db.Close()
query(db)
// ping
if err = db.PingContext(ctx); err != nil {
	fmt.Printf("ping failed: %v \n", err)
}

// clear test data from server
//defer db.ExecContext(ctx, "DELETE FROM kline")

// delete
//res, err := db.ExecContext(ctx, "DELETE FROM Organization")
res, err := db.ExecContext(ctx, " select MAKER_ID from kline")
if err != nil {
	fmt.Printf("failed sql execute: %v\n", err)
}
fmt.Println("res", res)
//nums, err := res.RowsAffected()
//log.Printf("deleted rows: %d %v", nums, err)
//
//// insert
res, err = db.ExecContext(ctx, `INSERT INTO PUBLIC.KLINE (MAKER_ID,CORE_SYM_ID,MAKER_SYM_ID,INTERVALS,TS,OPEN_PRICE,HIGH,LOW,CLOSE_PRICE,CHG,CHG_PCT,COUNT_NUM,TIME_OFFSET,VOLUME,TURNOVER) VALUES
 ('4','5','6','30',1714313275,1.123,312.1,1.12,1.3,1.11,1.112,600,288000,3000.0,280.9);`)
if err != nil {
	fmt.Printf("failed sql execute: %v", err)
}
//c, _ := res.RowsAffected()
//log.Printf("inserted rows: %d", c)
//
//// insert using prepare statement
//stmt, err := db.PrepareContext(ctx, "INSERT INTO Organization(_key, name, foundDateTime) VALUES"+
//	"(?, ?, ?),(?, ?, ?),(?, ?, ?)")
//if err != nil {
//	fmt.Printf("failed to prepare statement: %v", err)
//}
//res, err = stmt.ExecContext(ctx,
//	int64(12), "Org 12", time.Now(),
//	int64(13), "Org 13", time.Now(),
//	int64(14), "Org 14", time.Now())
//if err != nil {
//	fmt.Printf("failed sql execute: %v", err)
//}
//c, _ = res.RowsAffected()
//log.Printf("inserted rows: %d", c)
//
//// update
//res, err = db.ExecContext(ctx, "UPDATE Organization SET foundDateTime=? WHERE _key=?", time.Now(), int64(11))
//if err != nil {
//	fmt.Printf("failed sql execute: %v", err)
//}
//c, _ = res.RowsAffected()
//log.Printf("updated rows: %d", c)
//
//// select
//stmt, err = db.PrepareContext(ctx,
//	"SELECT _key, name, foundDateTime FROM Organization WHERE _key>=? AND _key<? ORDER BY _key ASC")
//if err != nil {
//	fmt.Printf("failed to prepare statement: %v", err)
//}
//rows, err := stmt.QueryContext(ctx, int64(11), int64(14))
//if err != nil {
//	fmt.Printf("failed sql query: %v", err)
//}
//cols, _ := rows.Columns()
//log.Printf("columns: %v", cols)
//var (
//	key  int64
//	name string
//	tm   time.Time
//)
//for rows.Next() {
//	if err := rows.Scan(&key, &name, &tm); err != nil {
//		fmt.Printf("failed to get row: %v", err)
//	}
//	log.Printf("key=%d, name=\"%s\", found=\"%v\"", key, name, tm)
//}

}

err1 failed to execute query: [1] 50000: Failed to set schema for DB connection for thread [schema=ignite]
failed sql execute: failed to execute query: [1] 42000: Given statement type does not match that declared by JDBC drive

Add TLS support

error go get

Hello amsokol,

How are you?

I get this error when I try to pull the package with go get :

"go get -u github.com/amsokol/ignite-go-client
go build github.com/amsokol/ignite-go-client: no non-test Go files in /home/tbeaudouin03/go/src/github.com/amsokol/ignite-go-client"

Doesn't work with out-of-the-box docker Ignite image

I am trying to get started with ignite.

From these docs

sudo docker run -it --net=host -e "CONFIG_URI=https://raw.githubusercontent.com/apache/ignite/master/examples/config/example-cache.xml" apacheignite/ignite

Ignite works fine. I tested it with python script

from pyignite import Client

client = Client()
client.connect('127.0.0.1', 10800)

#Create cache
my_cache = client.create_cache('my cache')

#Put value in cache
my_cache.put('my key', 42)

But if I try to access it with the go library. Then I have following errors. I used any your example

go

failed connect to server: failed to open connection: EOF

java from ignite logs

[22:24:37,694][SEVERE][grid-nio-worker-client-listener-2-#31][ClientListenerProcessor] Closing NIO session because of unhandled exception.
class org.apache.ignite.IgniteCheckedException: Invalid handshake message
	at org.apache.ignite.internal.processors.odbc.ClientListenerNioServerBuffer.read(ClientListenerNioServerBuffer.java:115)
	at org.apache.ignite.internal.processors.odbc.ClientListenerBufferedParser.decode(ClientListenerBufferedParser.java:60)
	at org.apache.ignite.internal.processors.odbc.ClientListenerBufferedParser.decode(ClientListenerBufferedParser.java:40)
	at org.apache.ignite.internal.util.nio.GridNioCodecFilter.onMessageReceived(GridNioCodecFilter.java:114)
	at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
	at org.apache.ignite.internal.util.nio.GridNioServer$HeadFilter.onMessageReceived(GridNioServer.java:3553)
	at org.apache.ignite.internal.util.nio.GridNioFilterChain.onMessageReceived(GridNioFilterChain.java:175)
	at org.apache.ignite.internal.util.nio.GridNioServer$ByteBufferNioClientWorker.processRead(GridNioServer.java:1132)
	at org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.processSelectedKeysOptimized(GridNioServer.java:2389)
	at org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.bodyInternal(GridNioServer.java:2156)
	at org.apache.ignite.internal.util.nio.GridNioServer$AbstractNioClientWorker.body(GridNioServer.java:1797)
	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
	at java.lang.Thread.run(Thread.java:748)

I saw instructions about ignite installation. And here I found setup from docker container. Container call CMD ./run.sh. And these sources I found here.

As I think only difference what I see is that run.sh doesn't do step 6 /bin/control.bat --activate .

I need to migrate Ignite cluster under kubernetes and there we will use only docker containers. And actually it's much easier to use docker.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.