Merge remote-tracking branch 'upstream/master' into quotaadd
This commit is contained in:
commit
5511e92ab2
|
@ -22,3 +22,9 @@ SSH_DIR=$USER_DIR/ssh
|
|||
# maybe it should be delete
|
||||
ssh-keygen -t rsa -P '' -f $SSH_DIR/id_rsa &>/dev/null
|
||||
cp $SSH_DIR/id_rsa.pub $SSH_DIR/authorized_keys
|
||||
|
||||
cat << EOF > $SSH_DIR/config
|
||||
Host *
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile=/dev/null
|
||||
EOF
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
# a naive script to fast start spark cluster, assuming host-0 master,
|
||||
# others slaves.
|
||||
# used with dl_stop_spark.sh
|
||||
|
||||
SPARK_HOME=/home/spark
|
||||
|
||||
HOSTS=`grep -v localhost /etc/hosts | awk '{print $2}'`
|
||||
|
||||
echo "Starting master in host-0"
|
||||
|
||||
$SPARK_HOME/sbin/start-master.sh
|
||||
|
||||
for h in $HOSTS ; do
|
||||
echo "Starting slave in $h"
|
||||
if [ $h != 'host-0' ] ; then
|
||||
ssh root@$h /home/spark/sbin/start-slave.sh spark://host-0:7077
|
||||
else
|
||||
/home/spark/sbin/start-slave.sh spark://host-0:7077
|
||||
fi
|
||||
done
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
# a naive script to stop spark cluster, assuming host-0 master
|
||||
# others slaves
|
||||
# used with dl_start_spark.sh
|
||||
|
||||
SPARK_HOME=/home/spark
|
||||
|
||||
HOSTS=`grep -v localhost /etc/hosts | awk '{print $2}'`
|
||||
|
||||
for h in $HOSTS ; do
|
||||
echo "Stopping slave in $h"
|
||||
if [ $h != 'host-0' ] ; then
|
||||
ssh root@$h /home/spark/sbin/stop-slave.sh
|
||||
else
|
||||
/home/spark/sbin/stop-slave.sh
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Stopping master in host-0"
|
||||
|
||||
$SPARK_HOME/sbin/stop-master.sh
|
||||
|
|
@ -72,7 +72,9 @@ echo "[*] Masking dbus.service"
|
|||
chroot $BASEFS systemctl mask dbus.service
|
||||
|
||||
echo "[*] Disabling apache2 service(if installed)"
|
||||
if [ -d $BASEFS/etc/apache2 ] ; then
|
||||
chroot $BASEFS update-rc.d apache2 disable
|
||||
fi
|
||||
|
||||
echo "[*] Disabling ondemand service(if installed)"
|
||||
chroot $BASEFS update-rc.d ondemand disable
|
||||
|
@ -81,10 +83,14 @@ echo "[*] Disabling dbus service(if installed)"
|
|||
chroot $BASEFS update-rc.d dbus disable
|
||||
|
||||
echo "[*] Disabling mysql service(if installed)"
|
||||
if [ -d $BASEFS/etc/mysql ] ; then
|
||||
chroot $BASEFS update-rc.d mysql disable
|
||||
fi
|
||||
|
||||
echo "[*] Disabling nginx service(if installed)"
|
||||
if [ -d $BASEFS/etc/nginx ] ; then
|
||||
chroot $BASEFS update-rc.d nginx disable
|
||||
fi
|
||||
|
||||
echo "[*] Setting worker_processes of nginx to 1(if installed)"
|
||||
[ -f $BASEFS/etc/nginx/nginx.conf ] && sed -i -- 's/worker_processes\ auto/worker_processes\ 1/g' $BASEFS/etc/nginx/nginx.conf
|
||||
|
@ -104,3 +110,17 @@ cp npmrc $BASEFS/root/.npmrc
|
|||
|
||||
echo "[*] Copying DOCKLET_NOTES.txt to $BASEFS/root/DOCKLET_NOTES.txt"
|
||||
cp DOCKLET_NOTES.txt $BASEFS/root/
|
||||
|
||||
echo "[*] Updating USER/.ssh/config to disable StrictHostKeyChecking"
|
||||
for f in $FS_PREFIX/global/users/* ; do
|
||||
cat <<EOF > $f/ssh/config
|
||||
Host *
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile=/dev/null
|
||||
EOF
|
||||
done
|
||||
|
||||
echo "[*] Generating $BASEFS/home/spark/sbin/dl_{start|stop}_spark.sh for Spark"
|
||||
if [ -d $BASEFS/home/spark/sbin ] ; then
|
||||
cp dl_*_spark.sh $BASEFS/home/spark/sbin
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue