Skip to content

Instantly share code, notes, and snippets.

@keepthinkingit
Forked from shui/after-install.md
Created March 30, 2018 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keepthinkingit/310bac2272ddcd5f1c2af722a46ef064 to your computer and use it in GitHub Desktop.
Save keepthinkingit/310bac2272ddcd5f1c2af722a46ef064 to your computer and use it in GitHub Desktop.
阿里云ECS安装后……

删除阿里云ECS登录欢迎信息

阿里云镜像修改了欢迎信息:

Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-105-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Welcome to Alibaba Cloud Elastic Compute Service !

删除/etc/motd倒数第二行的欢迎信息

卸载云盾

curl -sSL http://update.aegis.aliyun.com/download/quartz_uninstall.sh | sudo bash
sudo systemctl disable agentwatch.service
sudo rm -rf /usr/local/aegis
sudo rm /usr/sbin/aliyun-service
sudo rm /lib/systemd/system/aliyun.service

脚本备份:

#!/bin/bash

#check linux Gentoo os 
var=`lsb_release -a | grep Gentoo`
if [ -z "${var}" ]; then 
	var=`cat /etc/issue | grep Gentoo`
fi

if [ -d "/etc/runlevels/default" -a -n "${var}" ]; then
	LINUX_RELEASE="GENTOO"
else
	LINUX_RELEASE="OTHER"
fi

stop_aegis(){
	killall -9 aegis_cli >/dev/null 2>&1
	killall -9 aegis_update >/dev/null 2>&1
	killall -9 aegis_cli >/dev/null 2>&1
    printf "%-40s %40s\n" "Stopping aegis" "[  OK  ]"
}

stop_quartz(){
	killall -9 aegis_quartz >/dev/null 2>&1
        printf "%-40s %40s\n" "Stopping quartz" "[  OK  ]"
}

remove_aegis(){
if [ -d /usr/local/aegis ];then
    rm -rf /usr/local/aegis/aegis_client
    rm -rf /usr/local/aegis/aegis_update
fi
}

remove_quartz(){
if [ -d /usr/local/aegis ];then
	rm -rf /usr/local/aegis/aegis_quartz
fi
}


uninstall_service() {
   
   if [ -f "/etc/init.d/aegis" ]; then
		/etc/init.d/aegis stop  >/dev/null 2>&1
		rm -f /etc/init.d/aegis 
   fi

	if [ $LINUX_RELEASE = "GENTOO" ]; then
		rc-update del aegis default 2>/dev/null
		if [ -f "/etc/runlevels/default/aegis" ]; then
			rm -f "/etc/runlevels/default/aegis" >/dev/null 2>&1;
		fi
    elif [ -f /etc/init.d/aegis ]; then
         /etc/init.d/aegis  uninstall
	    for ((var=2; var<=5; var++)) do
			if [ -d "/etc/rc${var}.d/" ];then
				 rm -f "/etc/rc${var}.d/S80aegis"
		    elif [ -d "/etc/rc.d/rc${var}.d" ];then
				rm -f "/etc/rc.d/rc${var}.d/S80aegis"
			fi
		done
    fi

}

stop_aegis
stop_quartz
uninstall_service
remove_aegis
remove_quartz

printf "%-40s %40s\n" "Uninstalling aegis_quartz"  "[  OK  ]"

阿里云其他服务进程:

sudo systemctl stop accounts-daemon.service
sudo systemctl disable accounts-daemon.service
sudo systemctl stop aliyun-util.service
sudo systemctl disable aliyun-util.service
sudo systemctl stop cloud-config.service
sudo systemctl disable cloud-config.service
sudo systemctl stop cloud-final.service
sudo systemctl disable cloud-final.service
sudo systemctl stop cloud-init-local.service
sudo systemctl disable cloud-init-local.service
sudo systemctl stop cloud-init-upgrade.service
sudo systemctl disable cloud-init-upgrade.service
sudo systemctl stop cloud-init.service
sudo systemctl disable cloud-init.service
#如果需要删除可以执行
sudo rm /etc/systemd/system/aliyun-util.service
sudo rm -rf /etc/aliyun-util
sudo rm /lib/systemd/system/accounts-daemon.service
sudo rm /lib/systemd/system/cloud-final.service
sudo rm /lib/systemd/system/cloud-config.target
sudo rm /lib/systemd/system/cloud-init.service
sudo rm /lib/systemd/system/cloud-config.service
sudo rm /lib/systemd/system/cloud-init-upgrade.service
sudo rm /lib/systemd/system/cloud-init-local.service

屏蔽云盾IP

在安全组里屏蔽140.205.201.0/24,140.205.225.0/24,106.11.222.0/23,106.11.224.0/24,106.11.228.0/22

参考:
阿里云 ECS 监控卸载,屏蔽云盾 IP
卸载阿里云ECS监控服务

测试性能

curl -sSL https://raw.githubusercontent.com/teddysun/across/master/bench.sh | sudo bash

结果:

----------------------------------------------------------------------
CPU model            : Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
Number of cores      : 1
CPU frequency        : 2494.224 MHz
Total size of Disk   : 41.0 GB (2.1 GB Used)
Total amount of Mem  : 2000 MB (32 MB Used)
Total amount of Swap : 0 MB (0 MB Used)
System uptime        : 0 days, 19 hour 30 min
Load average         : 0.06, 0.23, 0.12
OS                   : Ubuntu 16.04.3 LTS
Arch                 : x86_64 (64 Bit)
Kernel               : 4.4.0-105-generic
----------------------------------------------------------------------
I/O speed(1st run)   : 56.4 MB/s
I/O speed(2nd run)   : 56.4 MB/s
I/O speed(3rd run)   : 56.4 MB/s
Average I/O speed    : 56.4 MB/s
----------------------------------------------------------------------

平均I/O吞吐量只有56M,回去翻了下云翼计划ECS的配置,发现玩了个trick:轻量应用服务器写的SSD云盘,ECS写的是高效云盘,实际性能差距还是很大。不过我没搞明白这两个有什么区别,轻量应用服务器也是可以装Ubuntu镜像的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment