Skip to content

Commit

Permalink
Fixes #123, #125, #126: moved to opt/mlvagrant, added yum cache updat…
Browse files Browse the repository at this point in the history
…es, added missing libs
  • Loading branch information
grtjn committed May 15, 2018
1 parent a51e35f commit 233d74e
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 58 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Scripts for bootstrapping a local MarkLogic cluster for development purposes usi
- Works on Windows, MacOS, and Linux
- Uses pre-built CentOS Vagrant base boxes
- Supports MarkLogic 5 up to 9
- Supports CentOS 5.11 up to 7.3
- Supports CentOS 5.11 up to 7.2
- Automatic setup of cluster
- Also installs MLCP, Java, NodeJS, Ruby, etc
- Highly configurable
Expand Down Expand Up @@ -52,7 +52,7 @@ Note: this project used to depend on chef/centos boxes, but they are no longer a
You first need to download and install prerequisites and mlvagrant itself:

- Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
- When using VirtualBox 5.1, make sure to use latest baseboxes, e.g. those for CentOS 6.9 and 7.3
- When using VirtualBox 5.1, make sure to use latest baseboxes, e.g. those for CentOS 6.9 and 7.2
- Download and install [Vagrant](https://www.vagrantup.com/downloads.html)
- Install the [vagrant-hostmanager](https://github.com/smdahlen/vagrant-hostmanager) plugin:
- `vagrant plugin install vagrant-hostmanager`
Expand All @@ -70,11 +70,11 @@ You first need to download and install prerequisites and mlvagrant itself:
- Download mlvagrant:
- `git clone https://github.com/grtjn/mlvagrant.git`
- or pull down one of its release zips
- Create `/opt/vagrant` (**For Windows**: `c:\opt\vagrant`), if it doesn't exist yet:
- `sudo mkdir -p /opt/vagrant`
- Create `/opt/mlvagrant` (**For Windows**: `c:\opt\mlvagrant`), if it doesn't exist yet:
- `sudo mkdir -p /opt/mlvagrant`
- Make sure Vagrant has read/exec access to that dir:
- `sudo chmod 755 /opt/vagrant`
- Copy `mlvagrant/opt/vagrant/*` to `/opt/vagrant/`
- `sudo chmod 755 /opt/mlvagrant`
- Copy `mlvagrant/opt/mlvagrant/*` to `/opt/mlvagrant/`

**IMPORTANT:**

Expand Down Expand Up @@ -149,7 +149,7 @@ VM naming pattern - defaults to {project_name}-ml{i}, also allowed: {ml_version}
**IMPORTANT: DON'T CHANGE ONCE YOU HAVE CREATED THE VM'S!!**

### vm_version
CentOS base VM version - defaults to 7.3, allowed: 5.11/6.5/6.6/6.7/6.8/6.9/7.0/7.1/7.2/7.3
CentOS base VM version - defaults to 7.2, allowed: 5.11/6.5/6.6/6.7/6.8/6.9/7.0/7.1/7.2

Note: MarkLogic 8+ does not support CentOS 5-
Note: MarkLogic 9+ does not support CentOS 6-
Expand Down Expand Up @@ -204,7 +204,7 @@ Override hard-coded MLCP installers (file is searched in /space/software, or c:\
### update_os
Run full OS updates - defaults to false

Note: doing this with CentOS 6.5 or 7.0 will take it up to the very latest minor release (6.9+ resp 7.3+)
Note: doing this with CentOS 6.5 or 7.0 will take it up to the very latest minor release (6.9+ resp 7.2+)

### install_dev_tools
Install group "Development tools" - defaults to false
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ if [ -f /vagrant/project.properties ]; then
sed 's/.*=/\L&/' /vagrant/project.properties > /tmp/$4.project.properties
elif [ -f project.properties ]; then
sed 's/.*=/\L&/' project.properties > /tmp/$4.project.properties
elif [ -f /opt/vagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/vagrant/project.properties > /tmp/$4.project.properties
elif [ -f /opt/mlvagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/mlvagrant/project.properties > /tmp/$4.project.properties
else
printf "ml_version=$2\n" > /tmp/$4.project.properties
fi

# Run the installers.
sudo /opt/vagrant/restore-yum-cache.sh
sudo /opt/vagrant/update-os.sh $4
sudo /opt/vagrant/install-ml-centos.sh $4
sudo /opt/vagrant/setup-ml-extra.sh $@
sudo /opt/vagrant/backup-yum-cache.sh
sudo /opt/mlvagrant/restore-yum-cache.sh
sudo /opt/mlvagrant/update-os.sh $4
sudo /opt/mlvagrant/install-ml-centos.sh $4
sudo /opt/mlvagrant/setup-ml-extra.sh $@
sudo /opt/mlvagrant/backup-yum-cache.sh
27 changes: 27 additions & 0 deletions opt/mlvagrant/bootstrap-centos-master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/sh
echo "running $0 $@"

# Convert all property keys to lowercase and store to tmp file to be sourced.
if [ -f /vagrant/project.properties ]; then
sed 's/.*=/\L&/' /vagrant/project.properties > /tmp/$4.project.properties
elif [ -f project.properties ]; then
sed 's/.*=/\L&/' project.properties > /tmp/$4.project.properties
elif [ -f /opt/mlvagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/mlvagrant/project.properties > /tmp/$4.project.properties
else
printf "ml_version=$2\n" > /tmp/$4.project.properties
fi

# Run the installers.
sudo /opt/mlvagrant/restore-yum-cache.sh
sudo /opt/mlvagrant/update-os.sh $4
sudo /opt/mlvagrant/install-ml-centos.sh $4
sudo /opt/mlvagrant/setup-ml-master.sh $1 $2 $3
sudo /opt/mlvagrant/install-node.sh $4
sudo /opt/mlvagrant/install-mlcp.sh $4
sudo /opt/mlvagrant/install-user.sh $4
sudo /opt/mlvagrant/setup-git.sh $4
sudo /opt/mlvagrant/setup-pm2.sh $4
sudo /opt/mlvagrant/setup-httpd.sh $4
sudo /opt/mlvagrant/setup-tomcat.sh $4
sudo /opt/mlvagrant/backup-yum-cache.sh
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ sleep 5
if [ -n "${converters_installer}" ]; then
installer=${converters_installer}

# Install dependencies required by MarkLogic Converters
yum -y install libgcc libgcc.i686 libstdc++ libstdc++.i686

# Run MarkLogic Converters installer
echo "Installing ML Converters using /space/software/$installer ..."
rpm -i "/space/software/$installer"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ if [ -f /vagrant/project.properties ]; then
sed 's/.*=/\L&/' /vagrant/project.properties > /tmp/$4.project.properties
elif [ -f project.properties ]; then
sed 's/.*=/\L&/' project.properties > /tmp/$4.project.properties
elif [ -f /opt/vagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/vagrant/project.properties > /tmp/$4.project.properties
elif [ -f /opt/mlvagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/mlvagrant/project.properties > /tmp/$4.project.properties
else
printf "ml_version=$2\n" > /tmp/$4.project.properties
fi

yum makecache fast

# Run the installers.
sudo /opt/vagrant/remove-ml.sh $5
sudo /opt/vagrant/install-ml-centos.sh $4
sudo /opt/mlvagrant/remove-ml.sh $5
sudo /opt/mlvagrant/install-ml-centos.sh $4
if [ "$5" == "true" ]; then
sudo /opt/vagrant/setup-ml-extra.sh $@
sudo /opt/mlvagrant/setup-ml-extra.sh $@
fi
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ if [ -f /vagrant/project.properties ]; then
sed 's/.*=/\L&/' /vagrant/project.properties > /tmp/$4.project.properties
elif [ -f project.properties ]; then
sed 's/.*=/\L&/' project.properties > /tmp/$4.project.properties
elif [ -f /opt/vagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/vagrant/project.properties > /tmp/$4.project.properties
elif [ -f /opt/mlvagrant/project.properties ]; then
sed 's/.*=/\L&/' /opt/mlvagrant/project.properties > /tmp/$4.project.properties
else
printf "ml_version=$2\n" > /tmp/$4.project.properties
fi

yum makecache fast

# Run the installers.
sudo /opt/vagrant/remove-ml.sh $5
sudo /opt/vagrant/install-ml-centos.sh $4
sudo /opt/mlvagrant/remove-ml.sh $5
sudo /opt/mlvagrant/install-ml-centos.sh $4
if [ "$5" == "true" ]; then
sudo /opt/vagrant/setup-ml-master.sh $1 $2 $3
sudo /opt/mlvagrant/setup-ml-master.sh $1 $2 $3
fi

# Also rerun MLCP installation
sudo rm -f /usr/local/mlcp
sudo /opt/vagrant/install-mlcp.sh $4
sudo /opt/mlvagrant/install-mlcp.sh $4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ if [ -f /vagrant/ml_${VERSION}_license.properties ]; then
source /vagrant/ml_${VERSION}_license.properties
elif [ -f ml_${VERSION}_license.properties ]; then
source ml_${VERSION}_license.properties
elif [ -f /opt/vagrant/ml_${VERSION}_license.properties ]; then
source /opt/vagrant/ml_${VERSION}_license.properties
elif [ -f /opt/mlvagrant/ml_${VERSION}_license.properties ]; then
source /opt/mlvagrant/ml_${VERSION}_license.properties
fi

echo "BOOTSTRAP_HOST is ${BOOTSTRAP_HOST}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ if [ -f /vagrant/ml_${VERSION}_license.properties ]; then
source /vagrant/ml_${VERSION}_license.properties
elif [ -f ml_${VERSION}_license.properties ]; then
source ml_${VERSION}_license.properties
elif [ -f /opt/vagrant/ml_${VERSION}_license.properties ]; then
source /opt/vagrant/ml_${VERSION}_license.properties
elif [ -f /opt/mlvagrant/ml_${VERSION}_license.properties ]; then
source /opt/mlvagrant/ml_${VERSION}_license.properties
fi

echo "BOOTSTRAP_HOST is ${BOOTSTRAP_HOST}"
Expand Down
3 changes: 2 additions & 1 deletion opt/vagrant/setup-pm2.sh → opt/mlvagrant/setup-pm2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ if [ $install_pm2 == "true" ] && [ $install_nodejs == "true" ]; then
if [[ $os == *"7."* ]]; then
# use systemd on CentOS 7
pm2 startup systemd -u pm2 --hp /home/pm2 --no-daemon
/bin/systemctl start pm2-pm2
else
# use service scripts on CentOS 6-
pm2 startup centos -u pm2 --hp /home/pm2 --no-daemon
/sbin/service pm2-init.sh start
fi
/sbin/service pm2-init.sh start
else
echo "WARN: pm2 user doesn't exist yet, could not init nor launch PM2 service!"
# well, technically, one could run it with root, but that is not recommended
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions opt/vagrant/update-os.sh → opt/mlvagrant/update-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ install_dev_tools=false
# Load the normalized project properties.
source /tmp/$1.project.properties

yum makecache fast

if [ $update_os == "true" ]; then
yum -y update
fi
Expand Down
27 changes: 0 additions & 27 deletions opt/vagrant/bootstrap-centos-master.sh

This file was deleted.

0 comments on commit 233d74e

Please sign in to comment.