Skip to content

Commit

Permalink
Updating m-apiserver(mayaserver) configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekpandey14 committed Mar 22, 2017
1 parent b075b38 commit 04c645f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion scripts/install_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ sudo chmod 0755 set_nomad_as_server.sh
cd /etc/maya.d/templates

echo "Fetching mayaserver config templates ..."
curl -sSL https://raw.githubusercontent.com/openebs/maya/master/templates/mayaserver.service.tmpl -o mayaserver.service.tmpl
curl -sSL https://raw.githubusercontent.com/openebs/maya/master/templates/m-apiserver.service.tmpl -o m-apiserver.service.tmpl
curl -sSL https://raw.githubusercontent.com/openebs/maya/master/templates/nomad_global.INI.tmpl -o nomad_global.INI.tmpl

echo "Fetching consul config templates ..."
Expand Down
23 changes: 11 additions & 12 deletions scripts/install_mayaserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@

set -e

MAYA_VERSION="0.0.6"
MAPI_VERSION="0.2-RC1"
CURDIR=`pwd`

#if [[ $(which mayaserver >/dev/null && mayaserver version | head -n 1 | cut -d ' ' -f 2 | sed 's/dev//' | cut -d "'" -f 2) == "$MAYA_VERSION" ]]; then
#echo "Mayaserver v$MAYA_VERSION already installed; Skipping"
#if [[ $(which m-apiserver >/dev/null && m-apiserver version | head -n 1 | cut -d ' ' -f 2 | sed 's/dev//' | cut -d "'" -f 2) == "$MAYA_VERSION" ]]; then
#echo "Maya-API Server v$MAYA_VERSION already installed; Skipping"
# exit
#fi

cd /tmp/

if [ ! -f "./mayaserver_${MAYA_VERSION}.zip" ]; then
echo "Fetching Mayaserver ${MAYA_VERSION} ..."
curl -sSL https://github.com/openebs/mayaserver/releases/download/${MAYA_VERSION}/mayaserver-linux_amd64.zip -o mayaserver_$MAYA_VERSION.zip
if [ ! -f "./m-apiserver_${MAPI_VERSION}.zip" ]; then
echo "Fetching Maya-API Server ${MAPI_VERSION} ..."
curl -sSL https://github.com/openebs/mayaserver/releases/download/${MAPI_VERSION}/m-apiserver-linux_amd64.zip -o m-apiserver_$MAPI_VERSION.zip
fi

echo "Installing Mayaserver ${MAYA_VERSION} ..."
unzip mayaserver_$MAYA_VERSION.zip
sudo chmod +x mayaserver
sudo mv mayaserver /usr/bin/mayaserver
echo "Installing Maya-API Server ${MAPI_VERSION} ..."
unzip m-apiserver_$MAPI_VERSION.zip
sudo chmod +x m-apiserver
sudo mv m-apiserver /usr/bin/

# Setup config directory for mayaserver
# Setup INI config directory for m-apiserver
sudo mkdir -p /etc/mayaserver/orchprovider
sudo chmod a+w /etc/mayaserver/orchprovider


cd ${CURDIR}
14 changes: 7 additions & 7 deletions scripts/start_mayaserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ set -e
SELF_IPV4=$1

if [ $# -eq 0 ]; then

# if no listen ip provided then start as localhost
SELF_IP4=127.0.0.1
fi
echo "Setting up Mayaserver Daemon ...with ip $SELF_IPV4"
echo "Setting up m-apiserver Daemon ...with ip $SELF_IPV4"

# Place systemd service template for Mayaserver
sudo cp /etc/maya.d/templates/mayaserver.service.tmpl /etc/systemd/system/mayaserver.service
sudo cp /etc/maya.d/templates/m-apiserver.service.tmpl /etc/systemd/system/m-apiserver.service
sudo cp /etc/maya.d/templates/nomad_global.INI.tmpl /etc/mayaserver/orchprovider/nomad_global.INI

# Replace the placeholders with actual values
sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/systemd/system/mayaserver.service
sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/systemd/system/m-apiserver.service

sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/mayaserver/orchprovider/nomad_global.INI

echo "Starting Mayaserver service ..."
echo "Starting m-apiserver service ..."

sudo systemctl enable mayaserver.service
sudo systemctl restart mayaserver.service
sudo systemctl enable m-apiserver.service
sudo systemctl restart m-apiserver.service
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Unit]
Description=Mayaserver Daemon
Description=m-apiserver Daemon

[Service]
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/bin/mayaserver up -bind=__SELF_IPV4__ &>mserver.log
ExecStart=/usr/bin/m-apiserver up -bind=__SELF_IPV4__ &>mapiserver.log
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM

Expand Down

0 comments on commit 04c645f

Please sign in to comment.