【玩转云耀云服务器HECS】华为云之使用HECS部署Linux dash轻量级监控面板

您所在的位置:网站首页 云服务器安装linux 【玩转云耀云服务器HECS】华为云之使用HECS部署Linux dash轻量级监控面板

【玩转云耀云服务器HECS】华为云之使用HECS部署Linux dash轻量级监控面板

2023-03-09 18:31| 来源: 网络整理| 查看: 265

一、HECS云耀云服务器介绍 1.HECS云耀云服务器简介

HECS(云耀云服务器)是可以快速搭建简单应用的新一代云服务器,具备独立、完整的操作系统和网络功能,适用于网站搭建、开发环境等低负载应用场景。

image.png

2.HECS云耀云服务器特点 易搭建:支持一站式配置指导,预装第三方市场镜像,新手小白也分钟级完成应用搭建 更实惠: 场景化套餐推荐,快速构建业务系统;根据用户业务诉求适配套餐,轻松购买更省力 易维护:极简控制台可视化管理;全方位性能监测,智能助手瑶光加持,保障业务稳定无忧 更安全: 主机安全防御、免费安全体检、安全升级指导、安全体检报告,多重保护性能无忧 二、本次技术分享介绍 1.本次技术分享介绍

1.熟练使用华为云云耀云服务器HECS产品; 2.使用HECS云耀云服务器部署Linux dash监控面板; 3.可以远程访问到Linux dash监控面板,了解HECS系统的各项指标状态。

2.Linux dash介绍

Linux-dash是一个低开销的、基于Web的Linux服务器监控系统。

三、购买华为云HECS云耀云服务器 1.购买说明

1.新用户可以直接前往开发者试用专区,免费领取ECS云耀云服务器, 官网地址:https://activity.huaweicloud.com/free_test/index.html 2.老用户直接选择包月购买即可。

image.png

2.进入购买界面

登录华为云官网,控制台——服务列表——云耀云服务器HECS

image.png

image.png

3.购买华为云HECS云耀云服务器

选择购买HECS云耀云服务器

image.png

区域:可定义,这里选择是西南——贵阳一; 系统镜像:选择centos7.6操作系统; 配置:选择入门型的即可,用于学习和测试; 密码:设置root密码,自定义。

image.png

增值服务:可勾选“开启详细云监控”,免费试用; 购买时长:选择一个月即可; 购买量:1台; 配置完毕后,选择立即购买

image.png

image.png image.png

4.查看购买的HECS状态

选择服务列表——云耀云服务器HECS,进入HECS控制台,看到刚购买的HECS云耀云服务器。

image.png

image.png

四、本地远程连接HECS 1.查看HECS的弹性公网IP

在HECS控制面板,查看当前云服务器的弹性公网IP。

image.png

2.本地连接HECS

打开本地Xshell工具,输入公网IP,云服务器的账号密码进行远程连接。

image.png

3.查看系统版本

检查操作系统版本

[root@hecs-4981 ~]# cat /etc/centos-release CentOS Linux release 7.6.1810 (Core) 4.检查系统内核版本 [root@hecs-4981 ~]# uname -r 3.10.0-1160.53.1.el7.x86_64 五、Linux环境配置工作 1.安装httpd

安装apache服务,用于网站的呈现。

yum -y install httpd 2.安装python

安装python工具

yum -y install python 3.安装git工具

安装git工具,用于在github下载Linux dash软件源码。

yum -y install git 3.启动httpd服务

启动httpd服务

systemctl enable --now httpd

查看httpd服务状态

[root@hecs-4981 ~]# systemctl status httpd ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2023-03-02 18:18:00 CST; 24h ago Docs: man:httpd(8) man:apachectl(8) Main PID: 568 (httpd) Status: "Total requests: 96; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service ├─ 568 /usr/sbin/httpd -DFOREGROUND ├─ 695 /usr/sbin/httpd -DFOREGROUND ├─ 696 /usr/sbin/httpd -DFOREGROUND ├─ 702 /usr/sbin/httpd -DFOREGROUND ├─ 714 /usr/sbin/httpd -DFOREGROUND ├─2179 /usr/sbin/httpd -DFOREGROUND ├─2199 /usr/sbin/httpd -DFOREGROUND ├─2289 /usr/sbin/httpd -DFOREGROUND ├─2326 /usr/sbin/httpd -DFOREGROUND ├─2327 /usr/sbin/httpd -DFOREGROUND └─2328 /usr/sbin/httpd -DFOREGROUND Mar 02 18:18:00 hecs-4981 systemd[1]: Starting The Apache HTTP Server... Mar 02 18:18:00 hecs-4981 systemd[1]: Started The Apache HTTP Server. 六、部署Linux dash应用 1.创建下载目录

创建一个下载目录,用于存放下载的Linux dash软件包。

[root@hecs-4981 ~]# mkdir -p /data/dash [root@hecs-4981 ~]# cd /data/dash/ [root@hecs-4981 dash]# 2.下载Linux dash软件包

使用git clone下载Linux dash软件包

[root@hecs-4981 dash]# git clone https://github.com/afaqurk/linux-dash.git Cloning into 'linux-dash'... remote: Enumerating objects: 4520, done. remote: Total 4520 (delta 0), reused 0 (delta 0), pack-reused 4520 Receiving objects: 100% (4520/4520), 4.58 MiB | 1.09 MiB/s, done. Resolving deltas: 100% (2671/2671), done. 3.查看Linux dash软件目录结构

查看Linux dash软件包目录结构

[root@hecs-4981 linux-dash]# tree ./ -L 3 ./ ├── app │ ├── index.html │ ├── linuxDash.min.css │ ├── linuxDash.min.js │ └── server │ ├── config │ ├── index.go │ ├── index.js │ ├── index.php │ ├── index.py │ └── linux_json_api.sh ├── bin │ └── linux-dash ├── demo.js ├── gulpfile.js ├── index.html ├── LICENSE.md ├── package.json ├── README.md └── src ├── css │ ├── buttons.css │ ├── main.css │ ├── plugins-cotnainer.css │ ├── README.md │ └── tables.css └── js ├── core ├── plugins └── README.md 9 directories, 21 files 4.创建网站目录 [root@hecs-4981 ~]# mkdir -p /var/www/dash [root@hecs-4981 ~]# cd /var/www/dash/ [root@hecs-4981 dash]# 5.拷贝文件到网站目录下

将Linux dash的文件全部拷贝到新建的网站目录下

[root@hecs-4981 dash]# cp -r /data/dash/linux-dash/* /var/www/dash/ [root@hecs-4981 dash]# ls app bin demo.js gulpfile.js index.html LICENSE.md package.json README.md src [root@hecs-4981 dash]# 6.编辑httpd服务配置文件

在/etc/httpd/conf.d/目录下,新建dash.conf配置文件

[root@hecs-4981 conf.d]# cat /etc/httpd/conf.d/dash.conf #Listen 8192 DocumentRoot /var/www/dash ServerName dash.example.com 7.重启httpd服务

重启httpd服务

systemctl restart httpd 8.修改index.py文件

在网站根目录下下,进入./app/server/目录下,修改idnex.py以下部分

[root@hecs-4981 server]# grep 8912 index.py parser.add_argument('--port', metavar='PORT', type=int, nargs='?', default=8912,

image.png

9.启动Linux dash服务

使用python启动Linux dash服务

[root@hecs-4981 server]# nohup python index.py & [1] 1869 10.查看Linux dash服务启动状态

检查Linux dash服务是否启动

[root@hecs-4981 server]# jobs [1]+ Running nohup python index.py & 七、安全组及防活墙配置 1.关闭防火墙

关闭防火墙,如果需要开启防火墙,则需要放行8912端口

systemctl stop firewalld && systemctl disable firewalld 2.关闭selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config getenforce 3.HECS的安全组设置

进入HECS安全组管理页面

image.png

安全组放行8912端口

image.png

八、访问Linux dash服务 http://140.210.218.184:8912/#/system-status

image.png

【玩转“云耀云服务器(HECS)”有奖征文来袭!惊喜大礼包激励等你来拿!】有奖征文第20期正在火热进行中: https://bbs.huaweicloud.com/blogs/391930



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3