systemd

etcd启动报错:couldn't find local name \"default\" in the initial cluster configuration

北城以北 提交于 2019-12-05 22:17:36
启动etcd的时候报错: # systemctl restart etcd Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details. # journalctl -xe Nov 28 10:26:07 mysql7 systemd[1]: Starting Etcd Server... -- Subject: Unit etcd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has begun starting up. Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_ADVERTISE_CLIENT_URLS=http://10.10.20.70:2379 Nov 28 10:26:07 abce

Why doesn't PHP 7.2 fopen(/tmp, a) write to the file?

大憨熊 提交于 2019-12-05 20:09:21
I have an old "PHPDBG" function that lets me "printf" to a text file. I've had PHPDBG.inc "since forever" (at least since PHP 4.x days), but it doesn't seem to be working in my current configuration (ubuntu18, Apache 2.4.29 and PHP 7.2). Specifically: I can't open the file ($fp is null) ... /tmp/PHPDBG.txt never gets created (because of the fopen failure) /tmp should be world-writable ... and ... I don't seem to be able to get a PHP error in the Apache error.log, or get anything meaningful from either error_get_last() or $php_errormsg . Here is the test code: test.php: <?php function PHPDBG (

使用systemctl管理服务

杀马特。学长 韩版系。学妹 提交于 2019-12-05 19:32:33
系统服务,开机不需要登录就能运行的程序(相当于开机自启) /usr/lib/systemd/system 用户服务,需要登录后才能运行的程序 /usr/lib/systemd/user 目录下又存在两种类型的文件: *.service 服务unit文件 *.target 开机级别unit 配置文件详解 以下为 Nginx 启动脚本 [Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=network.target remote-fs.target nss-lookup.target [Service] Type=forking User=nginx Group=nginx ExecStartPre=/usr/local/nginx/sbin/nginx -t ExecStart=/usr/local/nginx/sbin/nginx ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s stop [Install] WantedBy=multi-user.target [Unit] Documentation

kubeadm部署K8S集群v1.16.3

陌路散爱 提交于 2019-12-05 19:20:16
本次先更新kubeadm快速安装K8S,二进制安装上次没写文档,后续更新,此次最新的版本是V1.16.3 1、关闭防火墙、关闭selinux、关闭swapoff -a systemctl stop firewalld selinux=disabled swapoff -a 2、修改系统参数 创建 /etc/sysctl.d/k8s.conf 文件 cat > /etc/sysctl.d/k8s.conf << EOF net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF 生效配置文件 modprobe br_netfilter sysctl -p /etc/sysctl.d/k8s.conf 修改hosts cat > /etc/hosts << EOF master 192.168.200.221 node1 192.168.200.222 node2 192.168.200.223 EOF 3、安装docker 1)常用方法 a、配置yum源 阿里镜像源 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos

使用systemctl工具

我与影子孤独终老i 提交于 2019-12-05 17:23:52
使用 systemctl工具 8.1 问题 本例要求掌握 systemctl 控制工具的基本操作,完成下列任务: 重启 httpd 、 crond 、 bluetooth 服务,查看状态 禁止 bluetooth 服务开机自启,并停用此服务 设置默认级别为 multi-user.target 并确认 8.2 方案 systemd 是一个更高效的系统 & 服务管理器,其相关特性如下: 开机服务并行启动,各系统服务间的精确依赖 配置目录: /etc/systemd/system/ 服务目录: /lib/systemd/system/ systemctl 是 systemd 的管理工具,将相关资源组织为 unit 配置单元进行管理。 不同的 unit 决定了一组相关的启动任务, service 和 target 是最常用的配置单元: service :后台独立服务 target :一套配置单元的组合,类似于传统“运行级别” 8.3 步骤 实现此案例需要按照如下步骤进行。 步骤一:重启 httpd 、 crond 、 bluetooth 服务,查看状态 1 )重启系统服务 httpd 、 crond 、 bluetooth [root@svr7~]#systemctl restart httpd crond bluetooth 2 )查看上述服务的状态 [root@svr7~]

centos7.x设置nginx开机自启动

Deadly 提交于 2019-12-05 17:18:27
1、进入到/lib/systemd/system/目录 cd /lib/systemd/system/ 2、创建nginx.service文件 vi nginx.service 编辑内容如下: [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.target [Unit]:服务的说明 Description:描述服务 After:描述服务类别 [Service]服务运行参数的设置 Type=forking是后台运行的形式 ExecStart为服务的具体运行命令 ExecReload为重启命令 ExecStop为停止命令 PrivateTmp=True表示给服务分配独立的临时空间 注意:[Service]的启动、重启、停止命令全部要求使用绝对路径 [Install]运行级别下服务安装的相关设置,可设置为多用户,即系统运行级别为3 3

zabbix安装

爷,独闯天下 提交于 2019-12-05 17:02:20
#创建zabbix仓库(这里使用的是阿里云的zabbix 4.0版本的镜像地址) [root@localhost ~]# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm 获取https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm 警告:/var/tmp/rpm-tmp.Ypab1o: 头V4 RSA/SHA512 Signature, 密钥 ID a14fe591: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:zabbix-release-4.0-2.el7 ################################# [100%] #配置完成后可查看仓库列表 [root@localhost ~]# yum repolist 已加载插件:fastestmirror zabbix | 2.9 kB 00:00:00 zabbix-non-supported | 951 B 00:00:00

Spring boot部署CentOS7

不打扰是莪最后的温柔 提交于 2019-12-05 11:31:59
目标 把Spring boot的jar部署到CentOS7上面,并且随CentOS7随机启动。 Spring boot Jar bootJar { launchScript() } 然后,直接使用如下命令,进行构建: # 清理已经构建可执行jar ./gradlew clean # 重新构建可执行jar ./gradlew build # 验证spring boot jar是否有效 ./build/libs/xxx-1.0-SNAPSHOT.jar 创建用户 sudo useradd --system --home /var/myapp --shell /sbin/nologin --comment "myapp user" --user-group myapp 授权文件夹 chown -R nginx /var/myapp chgrp -R nginx /var/myapp systemd myapp.service /etc/systemd/system/myapp.service [Unit] Description=myapp After=syslog.target [Service] User=myapp Group=myapp ExecStart=/var/myapp/myapp.jar SuccessExitStatus=143 [Install] WantedBy

java: inconsistent watchdog timeout in systemd-notify

≯℡__Kan透↙ 提交于 2019-12-05 10:29:50
My java application gets installed onto on OpenSUSE 13.2 OS, and I'm using systemd for process control. (systemd version 210) I would like to take advantage of the systemd watchdog functionality using systemd-notify. However, I notice the app restarting due to inconsistent timeouts from the watchdog. With WatchdogSec=120, and the app configured to call systemd-notify every 60 seconds, I observe restarts every five to 20 minutes, on average. here is the (slightly redacted) systemd unit file for the process: # Cool systemd service [Unit] Description=Something Awesome After=awesomeparent.service

How do I build a Spring Boot jarfile that systemd can execute directly as a service?

蹲街弑〆低调 提交于 2019-12-05 10:26:04
How do I build a Spring Boot jarfile that systemd can directly execute as a service? Following the example in Installation as a systemd service , I created the following systemd service that directly executes a Spring Boot jarfile : [Unit] Description=CRS Self-certification Service Documentation= Requires=postgresql.service After=postgresql.service [Service] Environment=LOADER_PATH='lib/,config/,/etc/opes/crs/selfcertification' ExecStart=/opt/opes/crs/selfcertification/crs-selfcertification-1.0.0-SNAPSHOT.jar Restart=always RestartSec=10 User=crs [Install] WantedBy=multi-user.target However,