MADlib安裝過程

#download
#https://askubuntu.com/questions/831292/how-do-i-install-postgresql-9-6-on-any-ubuntu-version

#upgrading
#https://danielepestilli.com/en/blog/posts/3-upgrading-from-postgresql-9-5-to-9-6-on-ubuntu-16-04

#pl/python
#https://stackoverflow.com/questions/43984705/is-there-a-way-to-install-pl-python-after-the-database-has-been-compiled-without

#madlib
#https://cwiki.apache.org/confluence/display/MADLIB/Installation+Guide

#stop postgres
sudo /etc/init.d/postgresql stop

#install 9.6
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.6

#step1
sudo pg_dropcluster --stop 9.6 main
sudo pg_upgradecluster -v 9.6 9.5 main

#step2
sudo pg_dropcluster --stop 9.5 main
sudo apt-get purge postgresql-9.5*
sudo apt-get autoremove

#step3
/etc/init.d/postgresql start

#install pl/python(2.7)
sudo apt-get install postgresql-plpython-9.6

#check pl/python install (option)
SELECT * FROM pg_available_extensions WHERE name like '%plpython%';

#run madlib it's work now!!
/usr/local/madlib/bin/madpack -s madlib -p postgres -c postgres/postgres@localhost:5432/test install

發佈留言