Skip to content
Snippets Groups Projects
Commit fb6318ce authored by Kyle Doherty's avatar Kyle Doherty
Browse files

Merge remote-tracking branch 'origin/release-0.15.0' into multiseries_docs

parents eddd404a eb83224a
No related branches found
No related tags found
No related merge requests found
Showing
with 77 additions and 12 deletions
#!/usr/bin/env bash
VERSION="v0.15.0-snapshot"
VERSION="v0.15.0"
# dynamically pull more interesting stuff from latest git commit
HASH=$(git show-ref --head --hash=7 head) # first 7 letters of hash should be enough; that's what GitHub uses
......
......@@ -11,6 +11,7 @@ Cool, now you’re in the admin panel. Next, select **Databases** from the menu
Now you’ll see a list of your databases. To connect another database to Metabase, click **Add database**. Metabase currently supports the following types of databases:
* Amazon Redshift
* [Google BigQuery](databases/bigquery.md)
* H2
* MongoDB (version 3.0 or higher)
* MySQL
......@@ -56,7 +57,9 @@ When Metabase connects to your database, it tries to decipher the field types in
### Metadata Syncing
Metabase automatically syncs its copy of your database with the original database source every night, but if you'd like to sync your database manually at any time:
Metabase maintains it's own information about the various tables and fields in each Database that is added to aid in querying. This information is generally updated once each night to look for changes to the database such as new tables, but if you'd like to sync your database manually at any time:
NOTE: Metabase does NOT copy any data from your database, it only maintains lists of the tables and columns.
1. Go to the Admin Panel.
......
## Working with Google BigQuery in Metabase
Starting in v0.15.0 Metabase provides a driver for connecting to BigQuery directly and executing queries against any datasets you have. The below sections provide information on how to get connected and troubleshoot any issues that may come up.
### Connecting to a BigQuery Dataset
1. make sure you have a [Google Cloud Platform](https://cloud.google.com/) account with a Project you would like to use in Metabase.
* Start by giving this connection a __Name__ and providing your Google Cloud Platform __Project ID__ along with your desired BigQuery __Dataset ID__. If you don't have a dataset and want to play around with something we recommend copying one of the [sample tables](https://cloud.google.com/bigquery/sample-tables)
![basicfields](../images/bigquery_basic.png)
* Follow the `Click here` link provided below the __Client ID__ field which will open a new browser tab and guide you through the process of generating OAuth 2.0 credentials for Metabase. Make sure to choose `Other` for your application type.
![clientid](../images/bigquery_clientid.png)
* take the resulting client ID and client secret and copy them over to Metabase.
![clientid](../images/bigquery_clientdetails.png)
* Now follow the link below the __Auth Code__ field for `Click here to get an auth code` which will open a new browser window and authorize your credentials for a BigQuery access token to use the api. Simply click the `Allow` button.
![clientid](../images/bigquery_authcode.png)
* Copy the resulting code provided into the __Auth Code__ field in Metabase.
![clientid](../images/bigquery_copycode.png)
* Click the `Save` button!
Metabase will now begin inspecting your BigQuery Dataset and finding any tables and fields to build up a sense for the schema. Give it a little bit of time to do its work and then you're all set to start querying.
docs/administration-guide/images/bigquery_authcode.png

70.8 KiB

docs/administration-guide/images/bigquery_basic.png

71.7 KiB

docs/administration-guide/images/bigquery_clientdetails.png

29.7 KiB

docs/administration-guide/images/bigquery_clientid.png

59.4 KiB

docs/administration-guide/images/bigquery_copycode.png

26.6 KiB

# Running Metabase on Cloud66
If you are running Metabase on Cloud66 here's some info that may be helpful.
### Launching Metabase
More to come. Success has been reported using the Metabase docker image.
##### Using a loadbalancer
If you are running your Metabase instance behind a loadbalancer you are likely to see issues accessing the application until you apply the correct healthcheck url. In the Manifest.yml, put:
production:
load_balancer:
configuration:
httpchk: HEAD /api/health HTTP/1.1\r\nHost:haproxy
### Troubleshooting
* If you are seeing errors like `[WARN ] org.eclipse.jetty.http.HttpParser :: badMessage: 400 No Host for HttpChannelOverHttp@52b8a3a{r=0,c=false,a=IDLE,uri=-}` then checkout out the info above about setting the proper healthcheck url on your loadbalancer.
......@@ -16,7 +16,7 @@ The Metabase team runs a number of production installations on AWS using Elastic
Metabase provides an Elastic Beanstalk pre-configured launch url to help new installations getting started. If you are starting fresh we recommend you follow this link to begin creating the Elastic Beanstalk deployment with a few choices pre-filled.
[Launch Metabase on Elastic Beanstalk](http://downloads.metabase.com/v0.14.1/launch-aws-eb.html)
[Launch Metabase on Elastic Beanstalk](http://downloads.metabase.com/v0.15.0/launch-aws-eb.html)
The rest of this guide will follow each phase of the Elastic Beanstalk setup step-by-step.
......@@ -53,7 +53,7 @@ When your environment type settings look like the above then go ahead and click
The application version describes the exact binary you wish to deploy to your Elastic Beanstalk application. Metabase provides a pre-built AWS Elastic Beanstalk application version which can be linked to directly. Simply enter the following url in the `S3 URL` textbox:
https://s3.amazonaws.com/downloads.metabase.com/v0.14.1/metabase-aws-eb.zip
https://s3.amazonaws.com/downloads.metabase.com/v0.15.0/metabase-aws-eb.zip
Leave all the settings under Deployment Limits on their defaults. These settings won't impact Metabase.
......@@ -186,7 +186,7 @@ Here's each step:
1. Go to Elastic Beanstalk and select your `Metabase` application
* Click on `Application Versions` on the left nav (you can also choose `Application Versions` from the dropdown at the top of the page)
* Download the latest Metabase Elastic Beanstalk deployment file
* https://s3.amazonaws.com/downloads.metabase.com/v0.14.1/metabase-aws-eb.zip
* https://s3.amazonaws.com/downloads.metabase.com/v0.15.0/metabase-aws-eb.zip
* Upload a new Application Version
* Click the `Upload` button on the upper right side of the listing
* Give the new version a name, ideally including the Metabase version number (e.g. v0.13.0)
......
......@@ -22,6 +22,12 @@ This will launch a Heroku deployment using a github repository that Metabase mai
Now that you’ve installed Metabase, it’s time to [set it up and connect it to your database](../setting-up-metabase.md).
### Troubleshooting
* If your Metabase instance is getting stuck part way through the initialization process and only every shows roughly 30% completion on the loading progress.
* The most likely culprit here is a stale database migrations lock that was not cleared. This can happen if for some reason Heroku kills your Metabase dyno at the wrong time during startup. __To fix it:__ you can either clear the lock using the built-in [release-locks](start.md#metabase-fails-to-startup) command line function, or if needed you can login to your Metabase application database directly and delete the row in the `DATABASECHANGELOGLOCK` table. Then just restart Metabase.
# Deploying New Versions of Metabase
Upgrading to the next version of Metabase is a simple process where you will grab the latest version of [metabase-deploy](https://github.com/metabase/metabase-deploy) and push it to Heroku.
......
......@@ -32,6 +32,9 @@ Step-by-step instructions on how to deploy Metabase on Elastic Beanstalk using R
#### [Running on Heroku](running-metabase-on-heroku.md)
Currently in beta. We've run Metabase on Heroku and it works just fine, but it's not hardened for production use just yet. If you're up for it then give it a shot and let us know how we can make it better!
#### [Running on Cloud66](running-metabase-on-cloud66.md)
Community support only at this time, but we have reports of Metabase instances running on Cloud66!
# Troubleshooting Common Problems
......
......@@ -183,7 +183,11 @@
:cols cols
:rows (for [^TableRow row (.getRows response)]
(for [[^TableCell cell, parser] (partition 2 (interleave (.getF row) parsers))]
(parser (.getV cell))))}))
(when-let [v (.getV cell)]
;; There is a weird error where everything that *should* be NULL comes back as an Object. See https://jira.talendforge.org/browse/TBD-1592
;; Everything else comes back as a String luckily so we can proceed normally.
(when-not (= (class v) Object)
(parser v)))))}))
(defn- process-native* [database query-string]
(post-process-native (execute-query database query-string)))
......@@ -261,9 +265,14 @@
(declare driver)
;; this is never actually connected to, just passed to korma so it applies appropriate delimiters when building SQL
(def ^:private korma-db (-> (kdb/create-db (kdb/postgres {}))
(update :options assoc :delimiters [\[ \]])))
(def ^:private ^:const korma-db
{:pool {:subprotocol "sqlite"
:subname ""}
:options {:naming {:keys identity
:fields identity}
:delimiters [\[ \]]
:alias-delimiter " AS "
:subprotocol ""}})
(defn- entity [dataset-id table-name]
(-> (k/create-entity (k/raw (format "[%s.%s]" dataset-id table-name)))
......
......@@ -97,12 +97,12 @@
(memoize/ttl
(fn [spec]
(log/debug (u/format-color 'magenta "Creating new connection pool..."))
(kdb/connection-pool (assoc spec :minimum-pool-size 3
(kdb/connection-pool (assoc spec :minimum-pool-size 1
;; prevent broken connections closed by dbs by testing them every 3 mins
:idle-connection-test-period (* 3 60)
;; prevent overly large pools by condensing them when connections are idle for 15m+
:excess-timeout (* 15 60))))
:ttl/threshold (* 60 60 1000)))
:ttl/threshold (* 6 60 60 1000)))
(defn db->jdbc-connection-spec
"Return a JDBC connection spec for DATABASE. Normally this will have a C3P0 pool as its datasource, unless the database is `short-lived`."
......
......@@ -170,7 +170,7 @@
(defn- render-to-png
[^String html, ^ByteArrayOutputStream os, width]
(let [is (ByteArrayInputStream. (.getBytes html StandardCharsets/UTF_8))
doc-source (StreamDocumentSource. is nil "text/html")
doc-source (StreamDocumentSource. is nil "text/html; charset=utf-8")
parser (DefaultDOMSource. doc-source)
doc (.parse parser)
window-size (Dimension. width 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment