如何使用Laravel

时间:2015-12-28 19:00:26

标签: laravel

我正在使用DB::statement()方法在Laravel上运行原始查询。该语句需要从我的辅助数据库中获取数据。

我想知道是否有任何干净的方法来指定与此方法的数据库连接,而不是在所有字段之前使用数据库名称前缀。

1 个答案:

答案 0 :(得分:1)

是的,您可以使用[INFO] [Console$] Inspecting PredictionIO... [INFO] [Console$] PredictionIO 0.9.5 is installed at /Users/jia.huang/PredictionIO [INFO] [Console$] Inspecting Apache Spark... [INFO] [Console$] Apache Spark is installed at /Users/jia.huang/PredictionIO/vendors/spark-1.5.1 [INFO] [Console$] Apache Spark 1.5.1 detected (meets minimum requirement of 1.3.0) [INFO] [Console$] Inspecting storage backend connections... [INFO] [Storage$] Verifying Meta Data Backend (Source: ELASTICSEARCH)... [INFO] [Storage$] Verifying Model Data Backend (Source: LOCALFS)... [INFO] [Storage$] Verifying Event Data Backend (Source: HBASE)... [ERROR] [RecoverableZooKeeper] ZooKeeper exists failed after 1 attempts [ERROR] [ZooKeeperWatcher] hconnection-0x3035228, quorum=localhost:2181, baseZNode=/hbase Received unexpected KeeperException, re-throwing exception [WARN] [ZooKeeperRegistry] Can't retrieve clusterId from Zookeeper [ERROR] [StorageClient] Cannot connect to ZooKeeper (ZooKeeper ensemble: localhost). Please make sure that the configuration is pointing at the correct ZooKeeper ensemble. By default, HBase manages its own ZooKeeper, so if you have not configured HBase to use an external ZooKeeper, that means your HBase is not started or configured properly. [ERROR] [Storage$] Error initializing storage client for source HBASE [ERROR] [Console$] Unable to connect to all storage backends successfully. The following shows the error message from the storage backend. [ERROR] [Console$] Data source HBASE was not properly initialized. (io.prediction.data.storage.StorageClientException) [ERROR] [Console$] Dumping configuration of initialized storage backend sources. Please make sure they are correct. [ERROR] [Console$] Source Name: ELASTICSEARCH; Type: elasticsearch; Configuration: TYPE -> elasticsearch, HOME -> /Users/jia.huang/PredictionIO/vendors/elasticsearch-1.4.4 [ERROR] [Console$] Source Name: LOCALFS; Type: localfs; Configuration: PATH -> /Users/jia.huang/.pio_store/models, TYPE -> localfs [ERROR] [Console$] Source Name: HBASE; Type: (error); Configuration: (error) 方法,该方法接受存储在connection文件中的任何连接名称:

config/database.php

您可以在Using Multiple Database Connections文档中阅读更多内容。