Merge lp:~robert-ayres/charms/precise/hive/mysql-update into lp:charms/hive

Proposed by Robert Ayres
Status: Merged
Merged at revision: 6
Proposed branch: lp:~robert-ayres/charms/precise/hive/mysql-update
Merge into: lp:charms/hive
Diff against target: 96 lines (+6/-44)
2 files modified
README.md (+2/-43)
hooks/hive-common (+4/-1)
To merge this branch: bzr merge lp:~robert-ayres/charms/precise/hive/mysql-update
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review via email: mp+200577@code.launchpad.net

Description of the change

Updates to current MySQL charm removing the previous Known Issues and workarounds.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2013-09-09 14:38:23 +0000
3+++ README.md 2014-01-06 20:20:46 +0000
4@@ -51,8 +51,8 @@
5 A Hive server stores metadata in MySQL::
6
7 juju deploy mysql
8-
9-**Please read Known Issues 1. below before proceeding further**
10+ # hive requires ROW binlog
11+ juju set mysql binlog-format=ROW
12
13 To deploy a Hive service without a Metastore service::
14
15@@ -61,8 +61,6 @@
16 # associate Hive with MySQL
17 juju add-relation hive-server:db mysql:db
18
19-**Please read Known Issues 2. below before proceeding further**
20-
21 # associate Hive with HDFS Namenode
22 juju add-relation hive-server:namenode hadoop-master:namenode
23 # associate Hive with Jobtracker
24@@ -75,8 +73,6 @@
25 # associate Metastore with MySQL
26 juju add-relation hive-metastore:db mysql:db
27
28-**Please read Known Issues 2. below before proceeding further**
29-
30 # associate Metastore with Namenode
31 juju add-relation hive-metastore:namenode hadoop-master:namenode
32
33@@ -94,40 +90,3 @@
34 juju add-unit hive-server
35
36 This currently only works when using a Metastore service.
37-
38-## Known Issues
39-
40-
41- 1. The current MySQL Charm does not alter the binlog format to 'ROW' (nor can
42-the binlog be disabled) so attempting to use Hive will result in a nasty error
43-message of::
44-
45- 'Cannot execute statement: impossible to write to binary log since
46- BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine
47- limited to row-based logging. InnoDB is limited to row-logging when
48- transaction isolation level is READ COMMITTED or READ UNCOMMITTED.'
49-
50-The current solution is to ssh into a MySQL charm machine and manually set the
51-binlog format::
52-
53- sudo bash -c 'echo "binlog_format = ROW" >> /etc/mysql/conf.d/binlog.cnf'
54- sudo service mysql restart
55-
56-This should be done after deploying the MySQL charm.
57-
58- 1. The current MySQL Charm creates a database using 'utf8' encoding, which
59-will give you the following error with Hive::
60-
61- 'MetaException(message:Got exception: javax.jdo.JDODataStoreException An
62- exception was thrown while adding/validating class(es) : Specified key was
63- too long; max key length is 767 bytes'
64-
65-The current solution is drop the database and recreate it (to use 'latin1'
66-encoding)::
67-
68- mysql -u root -p`cat /var/lib/juju/mysql.passwd` -e 'drop database `<name>`; \
69- create database `<name>`;'
70-
71-where '<name>' is the service name, either 'hive-server' or 'hive-metastore'.
72-
73-This should be done after you have associated Hive with the database.
74
75=== modified file 'hooks/hive-common'
76--- hooks/hive-common 2012-03-22 15:33:35 +0000
77+++ hooks/hive-common 2014-01-06 20:20:46 +0000
78@@ -186,7 +186,7 @@
79
80 install_mysql_jdbc () {
81 juju-log "Installing mysql jdbc driver"
82- apt-get -y install libmysql-java
83+ apt-get -y install libmysql-java mysql-client
84 }
85
86 configure_mysql () {
87@@ -195,6 +195,9 @@
88 database=`relation-get database`
89 user=`relation-get user`
90 password=`relation-get password`
91+ # mysql charm creates databases defaulting to utf-8, hive requires latin1
92+ mysql -h $host -u "$user" "-p$password" "$database" \
93+ -e "ALTER DATABASE \`$database\` CHARACTER SET=latin1"
94 dir=`dotdee --dir /etc/hive/conf.juju/hive-site.xml`
95 rm -f $dir/6*-* $dir/7*-*
96 config_element hive.metastore.local true > $dir/61-hive.metastore.local

Subscribers

People subscribed via source and target branches

to all changes: