Vagrant.configure("2") do |config| config.vm.box = "generic/centos7" config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--cpus", "3"] vb.name = "decoderbufs" vb.memory = 4096 end $script = <<-SCRIPT yum update -y && yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm -y && yum install postgresql10-server postgresql10-devel postgresql10-contrib postgis25_10 postgis25_10-devel -y && yum install autoconf automake curl file gcc git libtool make pkgconfig libxml2-devel gdal-devel geos-devel unzip protobuf-c-devel.x86_64 -y && /usr/pgsql-10/bin/postgresql-10-setup initdb && systemctl enable postgresql-10 && cd / && wget http://download.osgeo.org/proj/proj-5.2.0.tar.gz && tar -xzvf proj-5.2.0.tar.gz && cd proj-5.2.0/ && ./configure && make && make install && cd / && wget https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz && tar -xzvf protobuf-2.6.1.tar.gz && cd protobuf-2.6.1/ && ./autogen.sh && ./configure && make && make install && export PG_CONFIG=/usr/pgsql-10/bin/pg_config export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig && cd / && git clone https://github.com/protobuf-c/protobuf-c.git && cd protobuf-c/ && ./autogen.sh && ./configure && make && make install && cd / && git clone https://github.com/debezium/postgres-decoderbufs && cd /postgres-decoderbufs/ && make && make install && echo "shared_preload_libraries = 'decoderbufs'" > /var/lib/pgsql/10/data/postgresql.auto.conf && echo "wal_level = logical" >> /var/lib/pgsql/10/data/postgresql.auto.conf && echo "max_wal_senders = 8" >> /var/lib/pgsql/10/data/postgresql.auto.conf && echo "wal_keep_segments = 4" >> /var/lib/pgsql/10/data/postgresql.auto.conf && echo "max_replication_slots = 4" >> /var/lib/pgsql/10/data/postgresql.auto.conf && systemctl start postgresql-10.service && systemctl status postgresql-10.service SCRIPT config.vm.provision "shell", inline: $script end