Apache Cassandra

From DreamFactory
Jump to: navigation, search
(Install the C/C++ driver)
 
Line 5: Line 5:
 
* DataStax C/C++ driver for Apache Cassandra - http://datastax.github.io/cpp-driver/  
 
* DataStax C/C++ driver for Apache Cassandra - http://datastax.github.io/cpp-driver/  
 
* DataStax PHP Cassandra extension - https://github.com/datastax/php-driver
 
* DataStax PHP Cassandra extension - https://github.com/datastax/php-driver
 +
** This can be installed via PECL '''OR''' built from source. Both methods are shown below.
  
 
== Linux ==  
 
== Linux ==  
Line 33: Line 34:
 
     sudo dpkg -i cassandra-cpp-driver-dev_2.6.0-1_amd64.deb
 
     sudo dpkg -i cassandra-cpp-driver-dev_2.6.0-1_amd64.deb
  
=== Install PHP Cassandra extension (build from source) ===
+
=== Install PHP Cassandra extension (Choose One) ===
 +
 
 +
==== PECL ====
 +
    sudo pecl install cassandra
 +
    sudo sh -c 'echo "extension=cassandra.so" > /etc/php/7.0/mods-available/cassandra.ini'
 +
    sudo phpenmod cassandra
 +
 
 +
==== Build from Source ====
  
 
     git clone https://github.com/datastax/php-driver.git
 
     git clone https://github.com/datastax/php-driver.git

Latest revision as of 19:36, 14 June 2017

Drivers

DreamFactory Cassandra service requires following drivers to be installed.

Linux

The following instructions are for Ubuntu (16.04) distribution with PHP 7. For other distributions or OS see http://datastax.github.io/cpp-driver/topics/

Install Prerequisites

Assuming PHP 7 and pear is already installed.

   sudo apt-get install php7.0-dev libgmp-dev libpcre3-dev g++ make cmake libssl-dev openssl

Install the C/C++ driver

Download the driver and dependencies (use the right version for your OS)...

   wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/dependenices/libuv/v1.8.0/libuv_1.11.0-1_amd64.deb
   wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/dependenices/libuv/v1.8.0/libuv-dev_1.11.0-1_amd64.deb
   wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/cassandra/v2.4.2/cassandra-cpp-driver_2.4.2-1_amd64.deb
   wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/cassandra/v2.4.2/cassandra-cpp-driver-dev_2.4.2-1_amd64.deb

Install them...

   sudo dpkg -i libuv_1.11.0-1_amd64.deb
   sudo dpkg -i libuv-dev_1.11.0-1_amd64.deb
   sudo dpkg -i cassandra-cpp-driver_2.6.0-1_amd64.deb
   sudo dpkg -i cassandra-cpp-driver-dev_2.6.0-1_amd64.deb

Install PHP Cassandra extension (Choose One)

PECL

   sudo pecl install cassandra
   sudo sh -c 'echo "extension=cassandra.so" > /etc/php/7.0/mods-available/cassandra.ini'
   sudo phpenmod cassandra

Build from Source

   git clone https://github.com/datastax/php-driver.git
   cd php-driver/ext
   phpize
   ./configure
   make
   sudo make install
   echo "extension=cassandra.so" | sudo tee /etc/php/7.0/mods-available/cassandra.ini
   sudo phpenmod cassandra
   

To make sure your drivers are installed correctly, restart your web server or php7.0-fpm if you are using nginx and run the command php -m. Confirm that cassandra shows up on the list of installed extensions.

That's it! You have successfully installed all required drivers for DreamFactory Cassandra service.