记录关于Devops运维,虚拟化容器云计算,数据库,网络安全等各方面问题。
RAW/QCOW2 与 vmdk 互转方法如果需要将KVM镜像下载回本地并通过VMware Workstation 查看,则需要在下载后进行转换,附一个Windows下Qemu-img 2.3版本,来自:https://cloudbase.it/qemu-img-windows/,其它用法实例也可以参考。下载地址:qemu-img-win-x64-2_3_0一、备份镜像方式:RAW:https://kwx.cc/post/3001QCOW2:直接在对应路径找文件二、转换命令1、RAW:qemu-img convert -f raw kwxcc.raw -O vmdk kwxcc.vmdk2、QCOW2:qemu-img convert -f qcow2 kwxcc.qcow2 -O vmdk kwxcc.vmdkkwxcc需要的文件名。在母鸡上执行,转换完vmdk后再下载回来。若提示没有qemu-img请直接yum install qemu-img –y安装后再操作。3、若是Windows下使用,qemu-img需带上绝对路径,如:qemu-img convert -f raw D:\kwxcc.raw -O vmdk E:\kwxcc.vmdk三、备注若为WINDOWS镜像,可能开机后会蓝屏,若遇到此问题可把vmware加载硬盘时格式选择IDE,不要选默认的SCSI。四、反转换若要将本地的VMware VMDK镜像转换为QCOW2或RAW1)如有安装VMTOOLS,先卸载之。/vmware-tools-distrib/bin/vmware-uninstall-tools.pl2)如果分割了很多子文件,合并之。vmware-vdiskmanager...
宝塔面板apache通过http跳转https与www域名方法博客程序使用catfish_blog后,发现无法使用 yjvps.com跳转到www.yjlink.cc上面了。现在博客添加https后,需要将原来的Http强制转到https上面,再将 yjvps.com跳转到www.yjlink.cc上面.通过宝塔面板,查看网站配置文件。1,强制 http转https,在80端口虚拟主机配置文件项目内添加发下内容。    #HTTP_TO_HTTPS_START    <IfModule mod_rewrite.c>        RewriteEngine on        RewriteCond %{SERVER_PORT} !^443$        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]    </IfModule>    #HTTP_TO_HTTPS_END完成后,即可强制 http转https。2,跳转到www域名上面,需要在443端口虚拟主机配置文件添加以下内容:RewriteEngine onRewriteCond %{HTTP_HOST} ^yjvps.com [NC]RewriteRule ^(.*)$ https://www.yjlink.cc/$1 [L,R=301]    完成后,即可跳转到www域名上面。
 
0

CentOS7搭建配置CephFS

发表者:admin分类:云计算容器2020-07-17 14:52:46 阅读[948]
CentOS7搭建配置CephFS所有节点关闭firewall和selinuxsystemctl stop firewalld systemctl disable firewalld setenforce 0 vim /etc/selimux/config selinux=disabled添加国内ceph源cat >/etc/yum.repos.d/ceph.repo<<EOF [ceph] name=ceph baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/x86_64/ gpgcheck=0 priority=1 [ceph-noarch] name=cephnoarch baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/noarch/ gpgcheck=0 priority=1 [ceph-source] name=Ceph source packages baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/SRPMS enabled=0 gpgcheck=1type=rpm-md gpgkey=http://mirrors.aliyun.com/ceph/keys/release.asc priority=1 EOFyum makecache在每一个node节点执行useradd ceph-adminecho 'ceph-admin' | passwd --stdin ceph-adminecho "ceph-admin ALL = (root) NOPASSWD:ALL" > /etc/sudoers.d/ceph-adminchmod 0440 /etc/sudoers.d/ceph...
如何仅在 CentOS/RHEL 8 中使用 dnf 列出或安装安全更新问:是否可能限制 dnf 以便仅列出或安装安全更新?如何仅使用安全勘误表修补系统?本文介绍如何使用 CentOS/RHEL 8 上的 dnf 列出和安装安全更新。列出安全更新1. 列出有关已安装软件包的较新版本(默认) 的建议:# dnf updateinfo list --security或# dnf updateinfo list --security --available2. 要列出有关已安装软件包任何版本的建议:# dnf updateinfo list --security --all3. 要列出有关相同和较旧版本的已安装软件包的建议:# dnf updateinfo list --security --installed4. 根据严重性列出安全更新(严重、重要、中等、低):# dnf updateinfo list --security --sec-severity [Severity]安装安全更新1. 在更新中包括与安全相关的包:# dnf upgrade --security2. 在更新中包括修复给定咨询或建议所需的包:# dnf upgrade --advisory ELSA-xxxx-xxxx或# dnf upgrade --advisories ELSA-xxxx-xxxx,ELSA-yyyy-yyyy3....
 
0

Redis 安全

发表者:admin分类:数据库2020-07-13 10:37:22 阅读[657]
Redis 安全我们可以通过 redis 的配置文件设置密码参数,这样客户端连接到 redis 服务就需要密码验证,这样可以让你的 redis 服务更安全。实例我们可以通过以下命令查看是否设置了密码验证:127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2) ""默认情况下 requirepass 参数是空的,这就意味着你无需通过密码验证就可以连接到 redis 服务。你可以通过以下命令来修改该参数:127.0.0.1:6379> CONFIG set requirepass "runoob" OK 127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2) "runoob"设置密码后,客户端连接 redis 服务就需要密码验证,否则无法执行命令。语法AUTH 命令基本语法格式如下:127.0.0.1:6379> AUTH password实例127.0.0.1:6379> AUTH "runoob" OK 127.0.0.1:6379> SET mykey "Test value" OK 127.0.0.1:6379> GET mykey "Test value"
 
0

Redis 数据备份与恢复

发表者:admin分类:数据库2020-07-13 09:39:21 阅读[711]
Redis 数据备份与恢复Redis SAVE 命令用于创建当前数据库的备份。语法redis Save 命令基本语法如下:redis 127.0.0.1:6379> SAVE 实例redis 127.0.0.1:6379> SAVE OK该命令将在 redis 安装目录中创建dump.rdb文件。恢复数据如果需要恢复数据,只需将备份文件 (dump.rdb) 移动到 redis 安装目录并启动服务即可。获取 redis 目录可以使用 CONFIG 命令,如下所示: redis 127.0.0.1:6379> CONFIG GET dir 1) "dir" 2) "/usr/local/redis/bin" 以上命令 CONFIG GET dir 输出的 redis 安装目录为 /usr/local/redis/bin。Bgsave创建 redis 备份文件也可以使用命令 BGSAVE,该命令在后台执行。实例127.0.0.1:6379> BGSAVE Background saving started
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

Understanding MySQL Query Cache

发表者:admin分类:数据库2020-07-10 14:59:51 阅读[803]
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...
    总共265页,当前第51页 | 页数:
  1. 41
  2. 42
  3. 43
  4. 44
  5. 45
  6. 46
  7. 47
  8. 48
  9. 49
  10. 50
  11. 51
  12. 52
  13. 53
  14. 54
  15. 55
  16. 56
  17. 57
  18. 58
  19. 59
  20. 60
  21. 61