Binary is good enough if you do not want to build from source. You can find the installation instructions here.
ldd /usr/local/lib/libignite-odbc.so
odbcinst.ini
contains the driver info. The name defined in this is used in the application.
Check if the driver definition is correct.
odbc.ini
contains the dns info. It could be empty. The DNS can be defined here if necessary.
This should point to the java home directory. For linux/ubuntu, check here for help.
This should contain the path in which the ignite driver is present. In my case, it is /usr/local/lib
.
Make sure to export LD_LIBRARY_PATH (export LD_LIBRARY_PATH
)
You might also want to add the location of libjvm.so
. This is needed if you want to
run the provided ignite examples. Refer here for help.
This should point to the ignite home directory
To start ignite, go to the ignite home directory and run bin/ignite.sh
script.
You can provide a custom config file if you have one. There are several sample configurations
in examples/config
under the ignite home directory
You can check if your php installation has odbc support using the command php -i | grep PDO
.
If it contains the lines PDO drivers => odbc, etc
, you have the odbc driver support
If the odbc is not listed in the PDO drivers, you either have to install the php-odbc package or enable the support in the php.ini file. In my case, I had to install the php5.6-odbc package.
To connect to ignite from php, I have used the PDO class provided by php. Refer here for further info. Use the following code to connect,
new \PDO('odbc:Driver=Apache Ignite;ADDRESS=127.0.0.1:10800;Cache=default');
The input string is the odbc connection string used to connect using the odbc driver.
Where Apache Ignite
is the driver name defined in odbcinst.ini and default
is the cache name you want to use
and ADDRESS
points to the server where ignite is running. Update them as necessary.
If the above string returns an error, check the error message. If the error says Failed to establish connection
, make sure the ignite server/application is running. If it is Data source name not found
, it means there is some problem with the driver/data source definition. Check your odbc.ini
and odbcinst.ini
files.
By default, ignite uses 10800
port for odbc connections
- You can use the
bin/ignitevisor.sh
script to check the status and address of the nodes - You can try with different connection strings if that helps. You can do this from php interactive console for an easier approach.
- Check if the ip and the port number are correct
Ignite can also be used as a cache through the php memcache interface. Check here for help.