记录关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题,
How to add a Custom Script to systemd in CentOS/RHEL 7如何在CentOS / RHEL 7中将自定义脚本添加到systemdThe systemd facility replaces the older System-V initialization scripts from earlier releases. The systemd is an event-driven facility which allows non-dependent subsystems to be started, controlled, or stopped in parallel. Here we explain how to add a custom script to the systemd facility.1. Write And Debug The Custom ScriptTypically a systemd script is written as a shell script. Begin by writing your custom script using the normal conventions. We will call our script my-custom-script.sh and is straightforward:#!/bin/sh echo I am a custom script2. The script must be executableLets make the script executable:# chmod 0755 my-custom-script.sh3. Describe The Custom Script To systemdWith the script written and tested manually, the script is ready to be described to the systemd system. To do this, a [name].service file is needed. The syntax uses the INI format commonly used for configurat...
环境:centos 7.1.1503 最小化安装依赖包下载:  yum -y install lrzsz zlib-devel perl gcc pam-devel1、安装openssl ,选用最新发布的版本:openssl-1.1.1g.tar.gz1)openssl下载地址:https://www.openssl.org/source/openssl-1.1.1g.tar.gz2)卸载系统预装的openssl ,这一步可以不做rpm -qa | grep openssl | grep -v libyum -y remove openssl-1.0.1e-42.el7.x86_64 3)安装步骤:tar -zxvf openssl-1.1.1g.tar.gzcd openssl-1.1.1g./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl -Wl,-rpath,/usr/local/openssl/lib sharedmake && make install4)创建软链接ln -s /usr/local/openssl/bin/openssl /usr/bin/opensslln -s /usr/local/openssl/include/openssl /usr/include/openssl5)更新系统配置echo "/usr/local/openssl/lib" >> /etc/ld.so.conf/sbin/ldconfig6)检查版本openssl version 2、安装openssh,选用最新发布的版本:openssh-8.3p1.tar.gz1)openssh下载地址:https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.3p1.tar.gz2)卸载系统预装的opensshrpm -qa | grep opens...
How To Shrink A Temporary Tablespace in Oracle DatabaseBy adminQuestion: How to resize the TEMPFILE(s) for a temporary tablespace after they have grown larger than needed?Large sort operations can cause temporary tablespaces to grow very large and as such there may be a need to ‘downsize’ after such operations. Until Oracle 11g there was no SQL command to release the unused allocated temporary space. One workaround for this problem is to create a new empty temporary tablespace with a smaller size, assign this new tablespace to the users and then drop the old tablespace. The disadvantage of this procedure is that it requires that no active sort operations are happening within the old temporary tablespace while it is being dropped.In Oracle 11g, a new feature was added that can be used to shrink temporary tablespaces. This command can be used to shrink only locally managed temporary tablespaces :ALTER TABLESPACE tablespace SHRINK SPACE | TEMPFILE tempfile_name [KEEP size];The&nbs...
 
0
What is MySQL Query CacheMySQL server features Query Cache Feature for a long time. When in use, the query cache stores the text of a SELECT query together with the corresponding result that is sent to a client. If another identical query is received, the server can then retrieve the results from the query cache rather than parsing and executing the same query again.It caches the full result set produced from a SELECT query:Queries executed must be identical.Cache is stored in system memory.Cache is checked before the query is parsed.Associated table updates invalidate query cache results. Prepared statements can be cached, but limitations exist. Some statements that do not use the query cache are:Queries that use nondeterministic functions.Queries that are a subquery of an outer queryQueries that are executed within the body of a stored function, trigger, or eventMySQL Query Cache SettingsThe query cache adds a few MySQL system variables for mysqld which may be set in a configuration...
Question: How to turn on scsi extended debug messages? What are the field/flag definitions of scsi_logging_level?Additional scsi logging messages can be enabled by writing to /proc/sys/dev/scsi/logging_level either via use of the echo or preferably the sysctl command. The kernel parameter consists of ten packed fields, each 3 bits in length. Each field can have a value of 0 to 7. The higher the field’s value, the more verbose the logging of messages associated with that field type.NOTE: Turning on high levels of extended logging and/or multiple types of extended logging can slow down system performance, especially during boot and shutdown. Unless needed, avoid turning on scsi logging during boot up.Run Time1. Enable :# sysctl -q -w dev.scsi.logging_level=[N]or# echo [N] > /proc/sys/dev/scsi/logging_levelWhere N specifies which fields to enable and at what level of verbosity.2. Disable:# sysctl -q -w dev.scsi.logging_level=0or# echo 0 > /p...
What is Chronyd ServiceIn CentOS/RHEL 7 and 8, the operating system’s time is set on every boot based on the hardware clock, which is a small-battery driven clock located on the motherboard of your computer. Often, this clock is too inaccurate or has not been set right, therefore it’s better to get your system time from a reliable source over the Internet (that uses real atomic time). The chrony daemon, chronyd, sets and maintains system time through a process of synchronization with a remote server using the NTP protocol for communication.In this post, we will learn to enable debug mode for chronyd service, which comes in very handy while troubleshooting any chronyd related issues. The configuration file used by chronyd service is /etc/sysconfig/chronyd.1. Edit the configuration file /etc/sysconfig/chronyd as a root user:# vi /etc/sysconfig/chronyd2. Add or Modify below line.OPTIONS="-dd"3. Copy /lib/systemd/system/chronyd.service to /etc/sys...
Configure Squid as HTTP and HTTPS Transparent ProxyLinux, Squid Proxyby adminThese days, it is really important to have proxy server to analyze web traffic of the organization. Among proxy servers, the Squid is very famous, because of it’s flexibility and easy of configuration. Squid can be operated at non-transparent and transparent mode which is going to discuss here. Main benefit of transparent mode is, clients are not aware that their requests are processed through the proxy. Simply there is no configuration at client side. So let’s look at how to configure Squid as HTTP and HTTPS Transparent Proxy Before begin please adjust the ip and other configuration as per your requirement. Below values are used only for demonstration.Internet –> ethointerface IP :- 192.168.2.39/24 Gateway:- 192.168.2.1LAN –> eth1interface IP :- 192.168.231.126/24  Gateway:- 0.0.0.0 If you have single interface no need to worry. you can create virtual interface wh...
   nginx使用 TCP代理sftp,实现访问目录文件 本文章向大家介绍nginx代理sftp,主要包括nginx代理sftp使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。 最近需要使用一个sftp协议的代理服务器,查了一下nginx1.9之后已经支持了,尝试一下: The ngx_stream_core_module module is available since version 1.9.0. This module is not built by default, it should be enabled with the --with-stream configuration parameter. nginx从1.9.0版本开始,新增了ngx_stream_core_module模块。默认编译的时候该模块并未编译进去,需要编译的时候添加--with-stream,使其支持stream代理。 [root@baseline opt]# / http:---- ::-- http:正在解析主机 nginx.org (nginx.org)... :1af8::a004:::e3, ., .|:1af8::a004:::e3|: (890K) [application/octet--..%[================================================================================================================================>] , 357KB/s 用...
    总共268页,当前第1页 | 页数:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11