{"id":176,"date":"2013-12-31T17:10:07","date_gmt":"2013-12-31T20:10:07","guid":{"rendered":"http:\/\/monitor.infracoop.com.ar\/blog\/?p=176"},"modified":"2016-03-18T16:52:14","modified_gmt":"2016-03-18T19:52:14","slug":"installing-greenplum-ce-community-edition-on-virtualbox","status":"publish","type":"post","link":"https:\/\/www.infracoop.com.ar\/?p=176","title":{"rendered":"Installing Greenplum CE (Community Edition) on Virtual Box."},"content":{"rendered":"<p>Hi again, this time I&#8217;m showing how to install and configure Greenplum CE in a single node. Also you will be available to download the .ova file, in order to import the appliance and have it installed in a Centos 6.5 64 bits.<\/p>\n<p>First of all, a little bit of about Greenplum \ud83d\ude42<\/p>\n<p>* Greenplum Database is a massively parallel processing (MPP) database server based on PostgreSQL open-source technology. MPP (also known as a shared nothing architecture) refers to systems with two or more processors which cooperate to carry out an operation &#8211; each processor with its own memory, operating system and disks.<br \/>\n* Greenplum Database is an array of individual databases based upon PostgreSQL 8.2 working together to present a single database image.<br \/>\n* Greenplum Database stores and processes large amounts of data by distributing the data and processing workload across several servers or hosts.<br \/>\n* The master is the entry point to the Greenplum Database system. and coordinates its work with the other database instances in the system, called segments. It is the segments where data is stored and the majority of query processing takes place.<\/p>\n<p>&#8212; Learn more here:<br \/>\n<a href=\"http:\/\/www.technology-mania.com\/2011\/04\/understanding-greenplum.html\" target=\"_blank\">http:\/\/www.technology-mania.com\/2011\/04\/understanding-greenplum.html<\/a><br \/>\n<a href=\"http:\/\/www.greenplumdba.com\/greenplum-database\" target=\"_blank\">http:\/\/www.greenplumdba.com\/greenplum-database<\/a><\/p>\n<p>&#8212; IMPORTANT: If you are a lazy DBA and you don&#8217;t want to do the installation, download the the virtual box appliance we made for you \ud83d\ude42 with Greenplum ready to use. Pass for root is qwe123 \ud83d\ude09<br \/>\nLink: <a href=\"https:\/\/mega.co.nz\/#!yR8GBbaA!WJqWWQVUMYohEUYAjB-N1npYLthT_S5od6EfZ8KyU5k\" target=\"_blank\">Greenplum Virtual Box appliance<\/a><\/p>\n<p>Now we are in the same page, lets install Greenplum CE in our Virtual box machine.<\/p>\n<p>Right now, i&#8217;m using Virtual Box 4.3.6 and I have installed Centos 6.5 64 bits. This part is not included in the how to \ud83d\ude42<\/p>\n<p>1) Once we have the OS ready, we need to install the YUM packages for XFS support:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> yum install xfsprogs xfsdump <\/pre>\n<p>2) We need another disk for the data storage. Add a new disk to the virtual machine and the create the xfs partition:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> mkfs -t xfs \/dev\/sdb <\/pre>\n<p>3) Add a line to the \/etc\/fstab to mount the partition onboot:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\u00a0vi \/etc\/fstab <\/pre>\n<p>\/dev\/sdb \/greenplum xfs noatime 0 0<\/p>\n<p>4) Now we create the Greenplum data store and mount the partition on the \/greenplum mount point.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\u00a0mkdir \/greenplum\r\n mount \/greenplum <\/pre>\n<p>5) Before running the installation we need to tweak some system parameters in \/etc\/sysctl.conf :<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> vi \/etc\/sysctl.conf <\/pre>\n<p>xfs_mount_options = rw,noatime,inode64,allocsize=16m<br \/>\nkernel.shmmax = 500000000<br \/>\nkernel.shmmni = 4096<br \/>\nkernel.shmall = 4000000000<br \/>\nkernel.sem = 250 512000 100 2048<br \/>\nkernel.sysrq = 1<br \/>\nkernel.core_uses_pid = 1<br \/>\nkernel.msgmnb = 65536<br \/>\nkernel.msgmax = 65536<br \/>\nkernel.msgmni = 2048<br \/>\nnet.ipv4.tcp_syncookies = 1<br \/>\nnet.ipv4.ip_forward = 0<br \/>\nnet.ipv4.conf.default.accept_source_route = 0<br \/>\nnet.ipv4.tcp_tw_recycle = 1<br \/>\nnet.ipv4.tcp_max_syn_backlog = 4096<br \/>\nnet.ipv4.conf.all.arp_filter = 1<br \/>\nnet.ipv4.ip_local_port_range = 1025 65535<br \/>\nnet.core.netdev_max_backlog = 10000<br \/>\nvm.overcommit_memory = 2<\/p>\n<p>6) And also in \/etc\/security\/limits.conf<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> vi \/etc\/security\/limits.conf <\/pre>\n<p>* soft nofile 65536<br \/>\n* hard nofile 65536<br \/>\n* soft nproc 131072<br \/>\n* hard nproc 131072<\/p>\n<p>7) We set the disk access policy for the linux disk I\/O scheduler:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\u00a0echo deadline &gt; \/sys\/block\/sdb\/queue\/scheduler <\/pre>\n<p>8) Finally we set the disk device file value for read-ahead (blockdev) to 16384 and we are done with SO tweaking!<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> \/sbin\/blockdev --setra 16385 \/dev\/sdb <\/pre>\n<p>9) You can get the installation file from the Pivotal site (http:\/\/www.gopivotal.com\/products\/pivotal-greenplum-database). You will get a zip file. Unzippit and then run the binary. After the installation is done, you will find the DB installed on \/usr\/local\/greenplum-db<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> unzip \/root\/greenplum-db-4.2.2.4-build-1-CE-RHEL5-x86_64.zip\r\n \/bin\/bash greenplum-db-4.2.2.4-build-1-CE-RHEL5-x86_64.bin <\/pre>\n<p>10) Now we need to create the OS user to admin the Greenplum DB, and of course, chown the master and segments directories to the user.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> useradd gpadmin\r\n passwd gpadmin&amp;lt\r\n mkdir -p \/greenplum\/master\r\n mkdir -p \/greenplum\/segment1\r\n mkdir -p \/greenplum\/segment2\r\n chown -R gpadmin:gpadmin \/greenplum <\/pre>\n<p>11) From now on, all the you have to do will be with gpadmin user, so, sudo su &#8211; gpadmin \ud83d\ude42<\/p>\n<p>12) We set the environment for gpadmin by copying the following to the .bashrc file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> vi \/home\/gpadmin\/.bashrc <\/pre>\n<p>##########################################################################<\/p>\n<p>GPHOME=\/usr\/local\/greenplum-db-4.2.2.4<\/p>\n<p># Replace with symlink path if it is present and correct<br \/>\nif [ -h ${GPHOME}\/..\/greenplum-db ]; then<br \/>\nGPHOME_BY_SYMLINK=`(cd ${GPHOME}\/..\/greenplum-db\/ &amp;&amp; pwd -P)`<br \/>\nif [ x&#8221;${GPHOME_BY_SYMLINK}&#8221; = x&#8221;${GPHOME}&#8221; ]; then<br \/>\nGPHOME=`(cd ${GPHOME}\/..\/greenplum-db\/ &amp;&amp; pwd -L)`\/.<br \/>\nfi<br \/>\nunset GPHOME_BY_SYMLINK<br \/>\nfi<br \/>\nPATH=$GPHOME\/bin:$GPHOME\/ext\/python\/bin:$PATH<br \/>\nLD_LIBRARY_PATH=$GPHOME\/lib:$GPHOME\/ext\/python\/lib:$LD_LIBRARY_PATH<br \/>\nPYTHONPATH=$GPHOME\/lib\/python<br \/>\nPYTHONHOME=$GPHOME\/ext\/python<br \/>\nOPENSSL_CONF=$GPHOME\/etc\/openssl.cnf<br \/>\nexport GPHOME<br \/>\nexport PATH<br \/>\nexport LD_LIBRARY_PATH<br \/>\nexport PYTHONPATH<br \/>\nexport PYTHONHOME<br \/>\nexport OPENSSL_CONF<\/p>\n<p>##########################################################################<\/p>\n<p>13) We need to edit the single_host_file and add the localhost entry, in order to crate the keys:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> vi ~\/single_host_file <\/pre>\n<p>localhost<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> gpssh-exkeys -f ~\/single_host_file <\/pre>\n<p>14) We need to create a configuration file to be used by the init process:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> vi ~\/gp_init_config <\/pre>\n<p>#####################################################################<\/p>\n<p>ARRAY_NAME=&#8221;Greenplum&#8221;<br \/>\nMACHINE_LIST_FILE=\/home\/gpadmin\/single_host_file<br \/>\nSEG_PREFIX=gp<br \/>\nPORT_BASE=50000<br \/>\ndeclare -a DATA_DIRECTORY=(\/greenplum\/segment1 \/greenplum\/segment2)<br \/>\nMASTER_HOSTNAME=localhost<br \/>\nMASTER_DIRECTORY=\/greenplum\/master<br \/>\nMASTER_PORT=5432<br \/>\nENCODING=UNICODE<\/p>\n<p>#####################################################################<\/p>\n<p>15) That&#8217;s all! Now start the database up!<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> gpinitsystem -c ~\/gp_init_config <\/pre>\n<p>16) Is it working? test it!<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> psql template1 <\/pre>\n<p>&#8212; Sources and help:<br \/>\n<a href=\"http:\/\/www.greenplumdba.com\/installing-the-greenplum-database\" target=\"_blank\">http:\/\/www.greenplumdba.com\/installing-the-greenplum-database<\/a><br \/>\n<a href=\"http:\/\/blog.2ndquadrant.com\/installing_greenplum_sne_ec2\/\" target=\"_blank\">http:\/\/blog.2ndquadrant.com\/installing_greenplum_sne_ec2\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi again, this time I&#8217;m showing how to install and configure Greenplum CE in a single node. Also you will be available to download the .ova file,&hellip; <span class=\"read-more\"><a class=\"more-link\" href=\"https:\/\/www.infracoop.com.ar\/?p=176\" rel=\"bookmark\">Read more <span class=\"screen-reader-text\">&#8220;Installing Greenplum CE (Community Edition) on Virtual Box.&#8221;<\/span><\/a><\/span><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,32],"tags":[38,39,61,37],"class_list":["post-176","post","type-post","status-publish","format-standard","hentry","category-noticias","category-postgresql","tag-greenplum","tag-how-to","tag-postgresql","tag-virtual-box"],"_links":{"self":[{"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=176"}],"version-history":[{"count":22,"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/176\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/176\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infracoop.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}