systemd

linux性能监控命令

空扰寡人 提交于 2020-01-21 03:43:18
1, Top命令: 用于按一定的顺序显示所有正在运行而且处于活动状态的实时进程,而且会定期更新显示结果。这条命令显示了CPU的使用率、内存使用率、交换内存使用大小、高速缓存使用大小、缓冲区使用大小,进程PID、所使用命令以及其他。它还可以显示正在运行进程的内存和CPU占用多的情况。 derek@ubox:~$ top -H top - 22:00:25 up 1 min, 1 user, load average: 1.08, 0.37, 0.13 Threads: 222 total, 1 running, 221 sleeping, 0 stopped, 0 zombie %Cpu(s): 3.9 us, 0.4 sy, 0.0 ni, 93.7 id, 0.0 wa, 0.0 hi, 2.1 si, 0.0 st KiB Mem : 1016124 total, 250380 free, 193484 used, 572260 buff/cache KiB Swap: 1046524 total, 1046524 free, 0 used. 655092 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1410 _apt 20 0 47084 5856 5416 S 7.6 0.6 0:01.61

nginx安装

风格不统一 提交于 2020-01-21 02:40:24
系统环境CentOS Linux release 7.7.1908 (Core) 安装make yum -y install gcc automake autoconf libtool make 安装g++ yum install gcc gcc-c++ 安装nginx cd /usr/local/src wget http://nginx.org/download/nginx-1.17.3.tar.gz tar -zxvf nginx-1.17.3.tar.gz cd nginx-1.17.3 ./configure make make install nginx 自启动 1、目录/usr/lib/systemd/system增加文件nginx.service 2、文件内容 [Unit] Description=nginx service After=network.target [Service] Type=forking ExecStart=/usr/local/nginx/sbin/nginx ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user

读懂这一篇,集群节点不下线

ぐ巨炮叔叔 提交于 2020-01-20 21:19:02
作者 | 声东 阿里云售后技术专家 导读 :排查完全陌生的问题、完全不熟悉的系统组件,是售后工程师的一大工作乐趣,当然也是挑战。今天借这篇文章,跟大家分析一例这样的问题。排查过程中,需要理解一些自己完全陌生的组件,比如 systemd 和 dbus。但是排查问题的思路和方法基本上还是可以复用了,希望对大家有所帮助。 问题一直在发生 1. I’m NotReady 阿里云有自己的 Kubernetes 容器集群产品。随着 Kubernetes 集群出货量的剧增,线上用户零星的发现,集群会非常低概率地出现节点 NotReady 情况。 据我们观察,这个问题差不多每个月就会有一到两个客户遇到。在节点 NotReady 之后,集群 Master 没有办法对这个节点做任何控制,比如下发新的 Pod,再比如抓取节点上正在运行 Pod 的实时信息。 2. 需要知道的 Kubernetes 知识 这里我稍微补充一点 Kubernetes 集群的基本知识。Kubernetes 集群的“硬件基础”,是以单机形态存在的集群节点。这些节点可以是物理机,也可以是虚拟机。集群节点分为 Master 和 Worker 节点。 Master 节点主要用来负载集群管控组件,比如调度器和控制器; 而 Worker 节点主要用来跑业务。Kubelet 是跑在各个节点上的代理,它负责与管控组件沟通,并按照管控组件的指示

三种方法解决 Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn'问题

半城伤御伤魂 提交于 2020-01-19 00:42:26
Failed to start LSB: Bring up/down networking 问题 1、执行 service network restart 出现以下错误 Restarting network ( via systemctl ) : Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details. 2、根据上面的提示,执行“systemctl status network.service”输出以下的类似信息: [ root@localhost ~ ] # systemctl status network.service network.service - LSB: Bring up/down networking Loaded: loaded ( /etc/rc.d/init.d/network ) Active: failed ( Result: exit-code ) since三 2014-11-05 15:30:10 CST ; 1min 5s ago 11月 05 15:30:10 localhost.localdomain network [ 2920 ] : RTNETLINK answers: File

Docker--2

﹥>﹥吖頭↗ 提交于 2020-01-19 00:06:52
文章目录 https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ ipconfig systemctl stop firewalld systemctl disable firewalld getenforce systemctl start iptables systemctl start iptables yum -y install iptables-services systemctl start iptables systemctl enable iptables iptables -F service iptables save yum update reboot rz -E mkdir docker mv docker* docker cd docker/ yum -y install * systemctl start docker systemctl enable docker systemctl status docker docker run hello-world cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service chmod a+x /etc/systemd/system/docker

Tests fail immediately with unknown error: DevToolsActivePort file doesn't exist when running Selenium grid through systemd

佐手、 提交于 2020-01-18 10:58:09
问题 I've been trying to change the way I start the Selenium grid service from a shell script in .rclocal to a systemd service, but it is not working. The script is this: #!/bin/bash java -jar /opt/selenium-server-standalone.jar -role hub -hubConfig hubconfig.json xvfb-run --server-args="-screen 0 2048x1536x24" java -jar /opt/selenium-server-standalone.jar -role node -nodeConfig nodeconfig.json I created two different services as follows: (Stackoverflow won't let me put the contents of the

Tests fail immediately with unknown error: DevToolsActivePort file doesn't exist when running Selenium grid through systemd

萝らか妹 提交于 2020-01-18 10:51:27
问题 I've been trying to change the way I start the Selenium grid service from a shell script in .rclocal to a systemd service, but it is not working. The script is this: #!/bin/bash java -jar /opt/selenium-server-standalone.jar -role hub -hubConfig hubconfig.json xvfb-run --server-args="-screen 0 2048x1536x24" java -jar /opt/selenium-server-standalone.jar -role node -nodeConfig nodeconfig.json I created two different services as follows: (Stackoverflow won't let me put the contents of the

Centos7中systemctl命令详解

一个人想着一个人 提交于 2020-01-16 18:37:52
LinuxSystemctl是一个系统管理守护进程、工具和库的集合,用于取代System V、service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器。通过Systemctl –help可以看到该命令主要分为:查询或发送控制命令给systemd服务,管理单元服务的命令,服务文件的相关命令,任务、环境、快照相关命令,systemd服务的配置重载,系统开机关机相关的命令。 1. 列出所有可用单元 # systemctl list-unit-files 2. 列出所有运行中单元 # systemctl list-units 3. 列出所有失败单元 # systemctl –failed 4. 检查某个单元(如 crond . service)是否启用 # systemctl is-enabledcrond.service 5. 列出所有服务 # systemctl list-unit-files –type=service 6. Linux中如何启动、重启、停止、重载服务以及检查服务(如 httpd . service)状态 # systemctl start httpd.service # systemctl restart httpd.service # systemctl stop httpd.service # systemctl reload

systemd servicefailed to connect to session d-bus

一曲冷凌霜 提交于 2020-01-16 03:54:10
问题 I have a application which has to connect to session dbus during bootup. If I start my application manually or start with initd, it is starting and connecting to session dbus. But if I start through systemd by giving command as systemctl --user start my-service which is in the path "/etc/systemd/user", it is showing the following error "Failed to connect to bus: No such file or directory". What can be the possible reasons? The service file is as follows: [Unit] Description=dummy application

Dockerfile理论+实战!!!

限于喜欢 提交于 2020-01-15 14:36:45
Dockerfile概述  Dockerfile是docker中镜像文件的的描述文件,说的直白点就是镜像文件到底是由什么东西一步步构成的。  例如:你在淘宝上买了一个衣架,但是卖家并没有给你发一个完整的衣架,而是一些组件和一张图纸,你按照这个图纸一步一步将衣架组装起来,就成了你所需要的样子。那么 Dockerfile 就是这张图纸,镜像文件就是你需要的这个衣架,Dockerfile 不建议随便命名,就用 Dockerfile。  因此,Dockerfile其内部包含了一条条的指令,每一条指令构建一层,因此每一条指令的内容,就是描述该层应当如何构建。 Docker 执行 Dockerfile 的大致流程: (1)docker从基础镜像运行一个容器; (2)执行一条指令并对容器作出修改; (3)执行类似docker commit的操作提交一个新的镜像层; (4)docker再基于刚提交的镜像运行一个新容器; (5)执行dockerfile中的下一条指令直到所有指令都执行完成。 不同阶段: 1、Dockerfile :是软件的原材料,需要定义一个Dockerfile,Dockerfile定义了进程需要的一切东西。Dockerfile涉及的内容包括执行代码或者是文件、环境变量、依赖包、运行时环境、动态链接库等等; 2、Docker镜像 :是软件的交付品