Skip to content

Commit

Permalink
[HOPSWORKS-1140] Online featurestore (logicalclocks#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Limmen authored and SirOibaf committed Oct 1, 2019
1 parent b39b1f8 commit fe77738
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Berksfile.lock
cookbooks/*
cookbooks
nohup.out
.idea
3 changes: 3 additions & 0 deletions Karamelfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ dependencies:
global:
- ndb::mgmd
- ndb::ndbd
- recipe: ndb::mysqld_tls
global:
- kagent::default
- recipe: ndb::memcached
global:
- ndb::mysqld
Expand Down
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@
# MySQL Server Master-Slave replication binary log is enabled.
default['mysql']['replication_enabled'] = "false"

# MySQL Server TLS/SSL enabled
default['mysql']['tls'] = "false"

# This is the username/password for any mysql server (mysqld) started.
# It is required by mysql clients to use the mysql server.
default['mysql']['user'] = "kthfs"
Expand Down
7 changes: 6 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
recipe "ndb::mgmd", "Installs a MySQL Cluster management server (ndb_mgmd)"
recipe "ndb::ndbd", "Installs a MySQL Cluster data node (ndbd)"
recipe "ndb::mysqld", "Installs a MySQL Server connected to the MySQL Cluster (mysqld)"
recipe "ndb::mysqld_tls", "Configure TLS for MySQL servers using host certificates"

recipe "ndb::purge", "Removes all data and all binaries related to a MySQL Cluster installation"

Expand Down Expand Up @@ -118,6 +119,10 @@
:description => "Enable replication for the mysql server",
:type => 'string'

attribute "mysql/tls",
:description => "Enable TLS/SSL for the mysql server",
:type => 'string'

attribute "ndb/wait_startup",
:description => "Max amount of time a MySQL server should wait for the ndb nodes to be up",
:type => 'string'
Expand Down Expand Up @@ -429,4 +434,4 @@

attribute "ndb/num_ndb_open_slots",
:description => "Number of slots open for new clients to connect.",
:type => "string"
:type => "string"
5 changes: 4 additions & 1 deletion recipes/mysqld.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
action :create
variables({
:mysql_id => found_id,
:my_ip => mysql_ip
:my_ip => mysql_ip,
# Here is always false, as this recipe is run before certificates are available
# if mysql/tls is enabled, the file will be re-templated later
:mysql_tls => false
})
if node['services']['enabled'] == "true"
notifies :enable, resources(:service => service_name), :immediately
Expand Down
4 changes: 4 additions & 0 deletions templates/default/grants.sql.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'localhost' identi
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1' identified by '<%= node['mysql']['password'] %>';
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'<%= @my_ip %>' identified by '<%= node['mysql']['password'] %>';
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'%' identified by '<%= node['mysql']['password'] %>';
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'localhost' identified by '<%= node['mysql']['password'] %>';
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1' identified by '<%= node['mysql']['password'] %>';
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'<%= @my_ip %>' identified by '<%= node['mysql']['password'] %>';
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'%' identified by '<%= node['mysql']['password'] %>';


11 changes: 10 additions & 1 deletion templates/default/my-ndb.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,19 @@ ndb-batch-size=24M

# replication settings go here
<% if node['mysql']['replication_enabled'] == "true" -%>
server-id=@server_id
server-id=<%= @mysql_id %>
log-bin=mysql-bin
<% end -%>

#################################################
# TLS/SSL Settings
#################################################

<% if @mysql_tls -%>
# ssl-ca=<%= node['kagent']['certs_dir'] %>/hops_root_ca.pem
ssl-cert=<%= node['kagent']['certs_dir'] %>/pub.pem
ssl-key=<%= node['kagent']['certs_dir'] %>/priv.key.rsa
<% end -%>

#################################################
# mysql_cluster connection params
Expand Down

0 comments on commit fe77738

Please sign in to comment.