PredictionIO 安裝配置

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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章