Skip to content

Instantly share code, notes, and snippets.

@hanefi
Last active November 13, 2018 11:38
Show Gist options
  • Save hanefi/31b8c76bddb89167bb4945e518d83c5f to your computer and use it in GitHub Desktop.
Save hanefi/31b8c76bddb89167bb4945e518d83c5f to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt update
# Grub updates scare me, so i'll just keep outdated packages for now
# sudo apt upgrade -y
sudo apt install -y bison clang flex g++ gcc htop libreadline-dev \
llvm-6.0-dev make zlib1g-dev
curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash
git clone https://github.com/postgres/postgres.git
pushd postgres/
git checkout REL_11_STABLE
./configure --with-llvm LLVM_CONFIG=/usr/bin/llvm-config-6.0
make -j12
sudo make -j12 install
popd
tee -a ~/.bashrc << END
# After each command, save and reload history
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
PATH=/usr/local/pgsql/bin:$PATH
export PATH
END
source ~/.bashrc
git clone https://github.com/citusdata/citus.git
pushd citus
./configure --without-libcurl
sudo make -j12 install
popd
git clone https://github.com/citusdata/postgresql-hll.git
pushd postgresql-hll
PG_CONFIG=/usr/local/pgsql/bin/pg_config make
sudo make install PG_CONFIG=/usr/local/pgsql/bin/pg_config
popd
initdb db
tee -a db/postgresql.conf << END
shared_preload_libraries = 'citus'
listen_addresses = '*'
END
tee -a db/pg_hba.conf << END
# Allow unrestricted access to nodes in the local network. The following ranges
# correspond to 24, 20, and 16-bit blocks in Private IPv4 address spaces.
host all all 10.0.0.0/8 trust
END
pg_ctl -D db -l logfile start
psql postgres -c "CREATE EXTENSION citus;CREATE EXTENSION hll;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment