Download PredictionIO


Simply download PredictionIO's binary distribution and extract it.

下载PredictionIO的二进制版本并提取它


具体步骤如下:

$ wget http://download.prediction.io/PredictionIO-0.8.0.tar.gz

$ tar zxvf PredictionIO-0.8.0.tar.gz

$ cd PredictionIO-0.8.0

 


Installing Dependencies

安装依赖


1、Spark Setup


Apache Spark is the default processing engine for PredictionIO. Download Apache Spark release 1.1.0 package hadoop2.4. Extract the file, and set the SPARK_HOME configuration in conf/pio-env.sh to the Spark directory.


Apache Spark是PredictionIO默认的处理引擎,下载Apache Spark release 1.1.0 ,解压文件,然后设置环境变量


具体操作如下:


$ wget http://d3kbcqa49mib13.cloudfront.net/spark-1.1.0-bin-hadoop2.4.tgz

$ tar zxvf spark-1.1.0-bin-hadoop2.4.tgz

After that, edit conf/pio-env.sh in your PredictionIO installation directory. 


环境变量配置

For example,


SPARK_HOME=/home/abc/Downloads/spark-1.1.0-bin-hadoop2.4

Storage Setup



2、Elasticsearch Setup



By default, PredictionIO uses Elasticsearch at localhost as the data store to store its metadata. Simply install and run Elasticsearch, which looks like this:


PredictionIO默认用Elasticsearch这个数据库在本地存储它的元数据

Elasticsearch安装和运行具体操作如下:



$ wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz

$ tar zxvf elasticsearch-1.3.2.tar.gz

$ cd elasticsearch-1.3.2

$ bin/elasticsearch




If you are using a shared network, change the network.host line in config/elasticsearch.yml to network.host: 127.0.0.1 because by default, Elasticsearch looks for other machines on the network upon setup and you may run into weird errors if there are other machines that is also running Elasticsearch.



You may change the settings or even use another data store such as MongoDB. For details, please read Changing the Data Store.

如果你想换成其他数据库大体操作在最下面:


3、HBase Setup 

By default, PredictionIO's Data API uses HBase at localhost as the data store for event data.



具体操作如下:


$ wget http://archive.apache.org/dist/hbase/hbase-0.98.6/hbase-0.98.6-hadoop2-bin.tar.gz

$ tar zxvf hbase-0.98.6-hadoop2-bin.tar.gz

$ cd hbase-0.98.6-hadoop2-bin


You will need to at least add a minimal configuration to HBase to start it in standalone mode. Details can be found here. Here, we are showing a sample minimal configuration.



For production deployment, run a fully distributed HBase configuration.


Edit conf/hbase-site.xml and put the following in. You may replace /home/abc with your own home directory.

编辑 conf/hbase-site.xml,修改路径


 

   hbase.rootdir

   file:///home/abc/hbase

 

 

   hbase.zookeeper.property.dataDir

   /home/abc/zookeeper

 


Check the local.log file under the logs/ directory to make sure it's started correctly. 



Now you may start HBase.


启动hbase


$ bin/start-hbase.sh



Note that even the command returns immediately, you may have to wait for up to a minute before all the initialization is done (and then you can run eventserver).


Now you have installed everything you need to run PredictionIO!


Next: Reading Quick Start