Installation – Linux

Installation – Linux

#Helpers
yum install -y epel-release bc ntp.x86_64 screen tree catdoc id3lib html2text unrtf p7zip-plugins.x86_64  libjpeg-turbo.x86_64 poppler-utils unzip.x86_64 netpbm-progs.x86_64 perl-Image-ExifTool.noarch postgresql-server.x86_64 postgresql-contrib.x86_64;
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm;
yum install -y ffmpeg;
newcfg (){
	F="$1"
	chown --reference="$F" "$F".new
	chmod --reference="$F" "$F".new
	mv -f "$F".new "$F"
}
 
#PostgreSQL
/usr/bin/postgresql-setup initdb
chkconfig  --level 235 postgresql on
TMP=/var/lib/pgsql/data/pg_hba.conf
cp $TMP $TMP.origonal
cat $TMP | grep -vP "^ *host.*127" > $TMP.new
echo -e "host\tall\tall\t127.0.0.1/32\tpassword" >> $TMP.new
newcfg $TMP
TMP=/var/lib/pgsql/data/postgresql.conf
cp $TMP $TMP.origonal
MT=$(cat /proc/meminfo | grep MemTotal | perl -pe 's/^[^ ]* *([0-9]+) *kB$/$1\/1000/g');
#java+linux=(512+256)
ECS=$(echo "($MT-(512+256))/2" | bc);
SB=$(echo "($MT-(512+256))/4" | bc);
cat $TMP | perl -pe 's/^#?(effective_cache_size)[ \t]*=[ \t]*[^ \t]+([ \t].*)?$/$1 = '$ECS'MB$2/g' \
| perl -pe 's/^#?(shared_buffers)[ \t]*=[ \t]*[^ \t]+([ \t].*)?$/$1 = '$SB'MB$2/g' \
| perl -pe 's/^#?(max_locks_per_transaction)[ \t]*=[ \t]*[^ \t]+([ \t].*)?$/$1 = 512$2/g' \
| perl -pe 's/^#?(max_connections)[ \t]*=[ \t]*[^ \t]+([ \t].*)?$/$1 = 60$2/g' \
| perl -pe 's/^#?(checkpoint_segments)[ \t]*=[ \t]*[^ \t]+([ \t].*)?$/$1 = 30$2/g' \
| perl -pe 's/^#?(log_min_duration_statement)[ \t]*=[ \t]*[^ \t]+([ \t].*)?$/$1 = 30000$2/g' \
| perl -pe 's/^#?(log_line_prefix)[ \t]*=[ \t]*[^#]+(#.*)?$/$1 = '\''%m: '\''\t\t$2/g' \
> $TMP.new
newcfg $TMP
service postgresql start
su postgres -c 'cd ~/;/usr/bin/psql -d postgres -U postgres --file /opt/Noodle/init.sql'
 
#java (get an updated url from java.sun.com)
cd /opt
wget 'http://javadl.oracle.com/webapps/download/AutoDL?BundleId=207765' -O jre.tar.gz
tar -zxf jre.tar.gz
rm -f jre.tar.gz
 
#Noodle (first take note of your available ram and java location)
wget somewhere/Noodle.tar.gz
tar -zxf ./Noodle.tar.gz
cd ./Noodle
./configure
cp noodle.daemon /etc/init.d/noodle
chkconfig --add noodle
chkconfig --levels 235 noodle on
service noodle start

(see also latest version howto and version notes)

ssh root@my.server.tld
 
###########################################################
##postgres
yum install postgresql postgresql-server postgresql-server postgresql-contrib
chkconfig --level 235 postgresql on
service postgresql start
vim /var/lib/pgsql/data/pg_hba.conf
#    127.0.0.1/32 password
vim /var/lib/pgsql/data/postgresql.conf
#    maintenance_work_mem=128000
#    autovacuum = on
service postgresql restart
su postgres
pgsql -U postgres
CREATE LANGAUGE plpgsql;
CREATE DATABASE noodledb WITH ENCODING = 'UNICODE';
create user noodleuser with superuser password 'some long password';
GRANT ALL PRIVILEGES ON DATABASE noodledb to noodleuser;
\q
exit
 
###########################################################
##java (get an updated url from java.sun.com)
cd /opt
wget 'http://javadl.oracle.com/webapps/download/AutoDL?BundleId=207765' -O jre.tar.gz
tar -zxf jre.tar.gz
rm -f jre.tar.gz
 
###########################################################
##7z
#    you can use yum-priorities and rpmforge or you can do it from source
yum install p7zip p7zip-plugins
#    you might need to make a link from 7z to 7z[ar] for "which 7z" to work
 
###########################################################
##Noodle
wget somewhere/Noodle.tar.gz
tar -xvvf ./Noodle.tar.gz
cd ./noodle
#      take note of your available ram and java location
./configure

sudo -i
apt update
apt -y upgrade
apt -y dist-upgrade
apt install -y postgresql-contrib tree p7zip-full sysstat catdoc antiword html2text unrtf libid3-tools ffmpeg openjdk-8-jre poppler-utils unzip
cd /opt
tar -xf ./Noodle.tar.gz
cd ./Noodle
su postgres -c 'cd ~/;psql --file /opt/Noodle/init.sql'
./configure
mv noodle.daemon /etc/init.d/noodle
update-rc.d noodle defaults
service noodle start

(see also howto get a new version of PGSQL )

sudo -i
apt-get install -y postgresql-9.3 postgresql-contrib-9.3 default-jre p7zip-full screen
cd /opt
tar -xf ./Noodle.tar.gz
cd ./Noodle
echo "host all all 127.0.0.1/32 password" >> /etc/postgresql/9.3/main/pg_hba.conf
service postgres start
su postgres -c 'cd ~/;psql --file /opt/Noodle/init.sql'
./configure
mv noodle.daemon /etc/init.d/noodle
service noodle start
update-rc.d noodle defaults

Noodle works with PostgreSQL and uses the contributions which are included in the windows installer but installed separately with package management systems like apt and yum.

before PGSQL-v9 will need:

CREATE LANGUAGE plpgsql;

All versions need a user, database and rights and the following to load the lo-manage triggers(the windows Noodle installer will do this for you):

ALTER USER noodleuser WITH SUPERUSER;

You will need these SQLs if you are upgrading from an old version.

List what is available in the enabled repositories on your CentOS Install:
yum info postgresql-server.x86_64 | grep Version
Select a newer version form http://yum.postgresql.org/
yum install http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm
# if you are using priorities add some to /etc/yum.repos.d/pgdg-93-centos.repo
yum install postgresql93-contrib
service postgresql-9.3 initdb
service postgresql-9.3 start
Directories of interest are:
conf/var/lib/pgsql/9.3/data/
data/var/lib/pgsql/9.3/data/base/

List what is available in the enabled repositories on your Ubuntu install:
apt-cache search postgresql | grep -P "^postgresql-[0-9\.]+ "
Install the latest version:
R=$(lsb_release -c | perl -pe 's/.*\t//g')
echo "deb http://apt.postgresql.org/pub/repos/apt/ "$R"-pgdg main" > /etc/apt/sources.list.d/pgdg.list
apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get upgrade
P=$(apt-cache search postgresql | grep -P "^postgresql-contrib-[0-9\.]+ " | sort | tail -n 2 | head -n 1 | perl -pe 's/ .*//g')
apt-get install $P
Directories of interest are:
conf/etc/postgresql/9.4/main/
data/var/lib/postgresql/9.4/main/base/

There are numerous backup methods, generally complete or partial combined with cold or hot. The simple method is a cold complete backup;

  • Stop Noodle
  • Stop the database
  • Copy the database folder and the Noodle folder to a different disk
  • Start the database
  • Start Noodle
  • Send the copy to a different physical location

More options for database backups include;

  • Hot complete backups allow a you a snapshot of your database without stopping anything.
  • Hot partial backups can be used to backup only recent changes, allow for point in time recovery, and reduce server load.
  • Cold partial backups can decrease the time of a cold complete backup.

Hot partial backups can also be used to keep a warm backup server in case of disaster, at any time it will be a usable exact copy of your production database.

production environments should select a backup strategy to maximize flexibility while reducing server load and storage requirements.

For details on backup options please read your database documentation.

Also see  the windows postgres example

Windows

  • The Windows installer will make a service automatically for you.

Linux

The linux installer defaults to not adding a noodle service

  1. cp /opt/noodle/noodle.daemon /etc/init.d/noodle
  2. chmod 0755 /etc/init.d/noodle
  3. enable the service:
    • debian: update-rc.d noodle defaults
    • red hat: chkconfig --add noodle;chkconfig noodle on;