#!/bin/bash
echo "安装skywalking_agent.tar.gz,按任意键继续"
read -n1



cd /data/software
curl -O http://down.yadeaiot.net:8000/apache-skywalking-apm-es7-8.3.0.tar.gz 
tar -zxvf apache-skywalking-apm-es7-8.3.0.tar.gz
mkdir /data/skywalking
mv apache-skywalking-apm-bin-es7 /data/skywalking/

sed -i "s@8080@38080@g" /data/skywalking/apache-skywalking-apm-bin-es7/webapp/webapp.yml
sed -i "s@SW_STORAGE:h2@SW_STORAGE:elasticsearch7@g" /data/skywalking/apache-skywalking-apm-bin-es7/config/application.yml
#启动
/data/skywalking/apache-skywalking-apm-bin-es7/bin/startup.sh

netstat -anp|grep 38080

#开机启动
echo "/data/skywalking/apache-skywalking-apm-bin-es7/bin/startup.sh" >>/etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
echo echo "skywalking安装完成，端口为38080，访问地址IP:38080"
