Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions bigtop-deploy/puppet/modules/gpdb/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

class { 'gpdb::common::stop_master_in_admin_mode':
base_dir => "$db_base_dir",
nodes => $nodes,
gp_home => $gp_home,
master_port => $master_db_port,
require => Class['gpdb::common::configure_master_node']
Expand All @@ -75,7 +76,7 @@
db_base_dir => $gpdb::common::db_base_dir,
master_db_port => $gpdb::common::master_db_port,
segment_db_port_prefix => $gpdb::common::segment_db_port_prefix,
require => Class['gpdb::common::stop_master_in_admin_mode'],
require => [ Server["stop_if_running"], Class['gpdb::common::stop_master_in_admin_mode'] ],
start_or_stop => running,
}

Expand Down Expand Up @@ -107,28 +108,39 @@
package { ["python-lockfile"]:
ensure => latest,
}
package { ["gcc"]:
ensure => latest,
}
package { ["python-devel"]:
ensure => latest,
}
package { ["psutil"]:
ensure => latest,
provider => pip,
require => Package["python-pip"],
require => [ File["/usr/bin/pip-python"], Package["gcc"], Package["python-devel"] ],
}
package { ["paramiko"]:
ensure => latest,
provider => pip,
require => Package["python-pip"],
require => File["/usr/bin/pip-python"],
}
package { ["python-pip"]:
package { ["python2-pip"]:
ensure => latest,
require => [
Yumrepo["epel"],
Package["libffi-devel"],
Package["python-lockfile"],
],
}
file { '/usr/bin/pip-python':
ensure => 'link',
require => Package["python2-pip"],
target => '/usr/bin/pip',
}
}
/(?i:(SLES|opensuse))/: {
}
Amazon: { }
/(Amazon)/: { }
/(Ubuntu|Debian)/: {
package { ["libffi-dev"]:
ensure => latest,
Expand Down Expand Up @@ -274,15 +286,17 @@
}
}

class stop_master_in_admin_mode($base_dir = undef, $gp_home = undef, $master_port = undef){
exec { 'stop-master-db-in-admin-mode':
command => "stop-db.sh $base_dir/master/gpseg-1 $master_port",
path => '/home/gpadmin',
user => 'gpadmin',
require => [
Exec["create_master_db$base_dir/master/gpseg-1"],
File['/home/gpadmin/stop-db.sh']
],
class stop_master_in_admin_mode($nodes = undef, $base_dir = undef, $gp_home = undef, $master_port = undef){
if ($::fqdn == $nodes[0]) {
exec { 'stop-master-db-in-admin-mode':
command => "stop-db.sh $base_dir/master/gpseg-1 $master_port",
path => '/home/gpadmin',
user => 'gpadmin',
require => [
Exec["create_master_db$base_dir/master/gpseg-1"],
File['/home/gpadmin/stop-db.sh']
],
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion bigtop-deploy/puppet/modules/gpdb/templates/gp_dbid
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Greenplum Database identifier for this master/segment.
# Do not change the contents of this file.
dbid = <%= dbid %>
dbid = <%= @dbid %>
2 changes: 1 addition & 1 deletion bigtop-deploy/puppet/modules/gpdb/templates/init-db.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
if [ ! -d $1 ]; then
export LD_LIBRARY_PATH=<%= gp_home%>/lib:/lib;<%= gp_home%>/bin/initdb -E UNICODE -D $1 --locale=en_US.utf8 --max_connections=750 --shared_buffers=128000kB --is_filerep_mirrored=no --backend_output=$1.initdb
export LD_LIBRARY_PATH=<%= @gp_home %>/lib:/lib;<%= @gp_home %>/bin/initdb -E UNICODE -D $1 --locale=en_US.utf8 --max_connections=750 --shared_buffers=128000kB --is_filerep_mirrored=no --backend_output=$1.initdb
fi
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
<%= gp_home%>/bin/psql -p <%= master_port%> -d "template1" -c "insert into gp_fault_strategy(fault_strategy) values ('n');" || true
<%= @gp_home %>/bin/psql -p <%= @master_port %> -d "template1" -c "insert into gp_fault_strategy(fault_strategy) values ('n');" || true
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
<%= gp_home%>/bin/psql -p <%= master_port%> -d "template1" -c "INSERT INTO gp_segment_configuration (dbid, content, role, preferred_role, mode, status, hostname, address, port, replication_port) VALUES ($1, $2, 'p', 'p', 's', 'u', '$4', '$4', $3, null);insert into pg_filespace_entry (fsefsoid, fsedbid, fselocation) values (3052, $1, '$5');" || true
<%= @gp_home %>/bin/psql -p <%= @master_port %> -d "template1" -c "INSERT INTO gp_segment_configuration (dbid, content, role, preferred_role, mode, status, hostname, address, port, replication_port) VALUES ($1, $2, 'p', 'p', 's', 'u', '$4', '$4', $3, null);insert into pg_filespace_entry (fsefsoid, fsedbid, fselocation) values (3052, $1, '$5');" || true
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= gp_home%>/bin/postgres "-D" "<%= db_dir %>" "-p" "<%= port %>" "-b" "<%= dbid %>" "-z" "<%= z_options %>" "--silent-mode=true" "-i" "-M" "<%= m_options %>" "-C" "<%= content %>" <%= x_options %>
<%= @gp_home %>/bin/postgres -D <%= @db_dir %> -p <%= @port %> --gp_dbid=<%= @dbid %> --gp_num_contents_in_cluster=<%= @z_options %> --silent-mode=true -i -M <%= @m_options %> --gp_contentid=<%= @content %> <%= @x_options %>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
export PGPORT=<%= master_port%>;<%= gp_home%>/bin/pg_ctl -w -l $1/pg_log/startup.log -D $1 -o "-i -p <%= master_port%> -c gp_role=utility -M master -b 1 -C -1 -z 0 -m" start
export PGPORT=<%= @master_port %>; <%= @gp_home %>/bin/pg_ctl -w -l $1/pg_log/startup.log -D $1 -o "-p <%= @master_port %> --gp_dbid=1 --gp_num_contents_in_cluster=0 --silent-mode=true -i -M master --gp_contentid=-1 -x 0 -c gp_role=utility -m" start
4 changes: 2 additions & 2 deletions bigtop-deploy/puppet/modules/gpdb/templates/stop-db.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
<%= gp_home%>/bin/pg_ctl -p $2 -D $1 stop
#!/bin/bash
<%= @gp_home %>/bin/pg_ctl -p $2 -D $1 stop
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
<%= gp_home%>/bin/psql -p <%= master_port%> -d "template1" -c "select count(*) from gp_segment_configuration;"
<%= @gp_home %>/bin/psql -p <%= @master_port %> -d "template1" -c "select count(*) from gp_segment_configuration;"