systemctl

CentOS 7.4 安装Zabbix 3.4

别来无恙 提交于 2019-12-30 04:08:33
一、安装环境 1 [root@linuxidc ~]# cat /etc/RedHat-release 2 3 CentOS Linux release 7.4.1708 (Core) 关闭防火墙 1 [root@linuxidc ~]# systemctl stop firewalld.service #关闭防火墙 2 3 [root@linuxidc ~]# systemctl disable firewalld.service #开机不启动防火墙 4    关闭selinux 1 [root@linuxidc ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config #在/etc/selinux/config 把SELNUX=enforcing换成SELINUX=disabled 2 3 [root@linuxidc ~]# grep SELINUX=disabled /etc/selinux/config #过滤刚刚换的disabled 4 5 SELINUX=disabled 6 7 [root@linuxidc ~]# setenforce 0 #清空selinux的配置 8 9 setenforce: SELinux is disabled 二、数据库的安装及配置

linux 常见命令及说明杂记

廉价感情. 提交于 2019-12-29 08:04:27
systemctl 命令: systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。 示例: systemctl is-enabled iptables.service #查询服务是否开机启动 systemctl enable *.service #开机运行服务 systemctl disable *.service #取消开机运行 systemctl start *.service #启动服务 systemctl stop *.service #停止服务 systemctl restart *.service #重启服务 systemctl reload *.service #重新加载服务配置文件 systemctl status *.service #查询服务运行状态 systemctl --failed #显示启动失败的服务 systemctl list-unit-files --type=service #列出所有服务(包括启用的和禁用的) systemctl mask *.service #屏蔽(让它不能启动) systemctl unmask *.service #显示服务 示例: systemctl restart sshd 软链接说明: 当 我们需要在不同的目录,用到相同的文件时

Linux centOS Ubuntu --- 使用systemctl添加开机启动

喜你入骨 提交于 2019-12-29 08:04:12
我们对service和chkconfig两个命令都不陌生,systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。 systemctl is-enabled iptables.service systemctl is-enabled servicename.service #查询服务是否开机启动 systemctl enable *.service #开机运行服务 systemctl disable *.service #取消开机运行 systemctl start *.service #启动服务 systemctl stop *.service #停止服务 systemctl restart *.service #重启服务 systemctl reload *.service #重新加载服务配置文件 systemctl status *.service #查询服务运行状态 systemctl --failed #显示启动失败的服务 注:*代表某个服务的名字,如http的服务名为httpd 例如在 CentOS 7 上安装http [root@CentOS7 ~]# yum -y install httpd 启动服务(等同于service httpd start) systemctl start httpd.service 停止服务

Linux把程序设置成服务运行

血红的双手。 提交于 2019-12-29 08:04:00
在linux下,把程序设置systemctl服务,并开机启动。以nexus服务为例:进入usr/lib/systemd/system/目录 新建nexus.service文件,写入如下内容, 字段说明请百度systemctl服务的字段说明。 以nexus服务为例: 进入/usr/lib/systemd/system, 新建nexus.service文件,写入如下内容, 字段说明请百度systemctl服务的字段说明。 …… [Unit] Description=Nexus After=network.target remote-fs.target nss-lookup.target [Service] Type=forking Environment="JAVA_HOME=/usr/java/jdk1.8.0_144" ExecStart=/usr/local/nexus/nexus-3.7.1-02/bin/nexus start ExecStop=/usr/local/nexus/nexus-3.7.1-02/bin/nexus stop [Install] WantedBy=multi-user.target 保存退出,输入:systemctl reload *.service #重新加载服务配置文件。然后就可以启动服务了, systemctl start nexus

centos7 systemctl一些用法

白昼怎懂夜的黑 提交于 2019-12-29 08:03:32
systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。   systemctl is-enabled servicename.service #查询服务是否开机启动   systemctl enable *.service #开机运行服务   systemctl disable *.service #取消开机运行   systemctl start *.service #启动服务   systemctl stop *.service #停止服务   systemctl restart *.service #重启服务   systemctl reload *.service #重新加载服务配置文件   systemctl status *.service #查询服务运行状态   systemctl --failed #显示启动失败的服务 systemctl list-unit-files|grep enabled #查看已启动的服务列表 注:*代表某个服务的名字,如http的服务名为httpd 来源: https://www.cnblogs.com/hxphp/p/6699783.html

CentOS7 安装远程桌面

蓝咒 提交于 2019-12-28 07:17:13
yum 源使用是阿里的: https://opsx.alibaba.com/mirror?lang=zh-CN rm -rf /etc/yum.repos.d/* curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 一、桌面环境 首先安装桌面环境,这里安装 GNOME。 yum -y groups install "GNOME Desktop" 关于桌面环境相关命令 # 从命令行切换到桌面环境 startx # 获取当前启动模式 systemctl get-default # 修改启动模式为图形化 systemctl set-default graphical.target # 修改启动模式为命令行 systemctl set-default multi-user.target 默认启动桌面环境后以 root 用户自动登录 # 修改配置文件 vi /etc/gdm/custom.conf # 增加如下配置 [daemon] AutomaticLoginEnable=True AutomaticLogin=root 二、远程服务设置 # Windows 远程登录需要安装 Xrdp,需要 epel 源 wget -O /etc/yum.repos.d/epel

centos7安装rabbitmq

只愿长相守 提交于 2019-12-27 02:37:32
centos7安装rabbitmq-3.7.17 准备 访问rabbitmq官网下载页面: https://www.rabbitmq.com/download.html : 安装erlang 找到安装erlang: https://www.rabbitmq.com/install-rpm.html#install-from-esl-repository : 即: https://www.erlang-solutions.com/resources/download.html : 安装: wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_22.0.7-1~centos~7_amd64.rpm rpm -ivh esl-erlang_22.0.7-1~centos~7_amd64.rpm 安装过程中出现如下错误 error: Failed dependencies: libGL.so.1()(64bit) is needed by esl-erlang-19.3-1.x86_64 libGLU.so.1()(64bit) is needed by esl-erlang-19.3-1.x86_64 libodbc.so.2()(64bit) is needed by esl

NFS的搭建(linux-linux)

人走茶凉 提交于 2019-12-26 19:47:34
准备一台服务器和一台客户端 首先在 服务器 安装nfs-ntils和rpcbind [root@localhost ~]# yum -y install nfs-utils rpcbind 修改配置文件,允许客户端访问 [root@localhost ~]# vim /etc/exports [root@localhost ~]# cat /etc/exports /home/xxx 192.168.1.210(rw) 创建目录并增加权限 [root@localhost ~]# mkdir /home/xxx [root@localhost ~]# chomd 777 /home/xxx 开启服务,开启的顺序不能改变 [root@localhost ~]# systemctl start rpcbind [root@localhost ~]# systemctl start nfs 关闭防火墙,降低沙盒等级 [root@localhost ~]# systemctl stop firewalld [root@localhost ~]# setenforce 0 在 客户端 安装nfs-ntils和rpcbind [root@localhost ~]# yum -y install nfs-utils rpcbind 开启服务 [root@localhost ~]#

实例学习Ansible系列(18)服务管理的几种方式

孤者浪人 提交于 2019-12-26 19:34:57
Ansible中使用service等模块进行服务的管理,也可直接使用非幂等性的模块诸如shell等进行控制,这篇文章介绍常用的使用示例。 示例1: 使用service停止单个服务 比如停止etcd服务,示例如下 ## stop etcd service - name: stop etcd service service: name: etcd state: stopped 示例2: 使用service停止多个服务 比如停止kubernetes的master相关的服务,示例如下 ## stop kubernetes master service - name: stop master service service: name: "{{ item }}" state: stopped with_items: - kube-scheduler - kube-controller-manager - kube-apiserver 示例3: 无视错误 如果当当前机器上不存在service文件时,可能会出现如下类似的错误信息 fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find the requested service flanneld: host"} 这种情况下可以使用ignore

配置NFS服务

徘徊边缘 提交于 2019-12-26 17:02:39
配置NFS服务 服务端 ip :192.168.1.10 客户端 ip :192.168.1.227 (服务端与客户端均须关闭防火墙、降低沙盒) 服务端配置 用 yum 安装 nfs 以及rpcbind [root@bogon ~]# yum -y install nfs-utils rpcbind 编辑配置文件客户端访问,内容如下图 [root@bogon ~]# vim /etc/exports 创建目录 /home/xyl ,并赋予其权限 [root@bogon ~]# mkdir /home/xyl [root@bogon ~]# chmod 777 /home/xyl/ 按如下顺序开启服务 [root@bogon ~]# systemctl start rpcbind 关闭防火墙 [root@bogon ~]# systemctl start nfs [root@bogon ~]# systemctl stop firewalld 降低沙盒 [root@bogon ~]# getenforce Enforcing [root@bogon ~]# setenforce 0 [root@bogon ~]# getenforce Permissive 查看是否能 ping 通客户端 [root@bogon ~]# ping 192.168.1.227 客户端配置 用 yum