记录关于Devops运维,虚拟化容器云计算,数据库,网络安全等各方面问题。
centos中kvm网桥的设置禁用网络管理器 # chkconfig NetworkManager off# service NetworkManager stop 新建一个ifcfg-br0文件:DEVICE=br0TYPE=BridgeBOOTPROTO=staticBROADCAST=10.1.255.255IPADDR=10.1.29.3NETMASK=255.255.0.0NETWORK=10.1.0.0ONBOOT=yes 然后修改相应网卡的配置文件,我的是eth1:# Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit EthernetDEVICE=eth1#BOOTPROTO=none#BROADCAST=10.1.255.255HWADDR=D8:5D:4C:74:EE:E8#IPADDR=10.1.29.3#NETMASK=255.255.0.0#NETWORK=10.1.0.0ONBOOT=yes#TYPE=Ethernet#USERCTL=no#IPV6INIT=no#PEERDNS=yesBRIDGE=br0可以看出,原来网卡的配置只保留device名称,硬件地址,onboot选项,以及新添加的BRIDGE=br0。 然后重启网络:/etc/init.d/network restart 或service network restart 实验中在br0中加入gateway后,/etc/sysconfig/network中的gateway就消失了。成功后,利用route -n查看路由,发现所有的包都从br0走了。
1,首先,需要更新系统。#: yum update -y#: rebbot2,然后,安装gnome环境包。 #: yum groupinstall "GNOME Desktop" "Graphical Administration Tools" -y现在,我们要在服务器上安装 VNC 服务器了。4. yum 安装vnc #:yum install -y tigervnc tigervnc-server tigervnc-server-module -y5 配置vnc编辑# vim /lib/systemd/sytem/vncserver@.service找到下面这几行,用自己的用户名替换掉 。我的用户名是 root 所以我用 root 来替换掉 :ExecStart=/sbin/runuser -l -c "/usr/bin/vncserver %i"PIDFile=/home//.vnc/%H%i.pid替换为ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver :1 -geometry 1024x768 -depth 16"PIDFile=/root/.vnc/%H%i.pid将 /lib/systemd/system/vncserver@.service 改为 /lib/systemd/system/vncserver@:1.service#mv /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service重启 systemd#systemctl daemon-reload6.最后还要设置一下用户的 VNC 密码。要设置某个用户的密码,必须要有能通过 sudo 切换到用户的权限,这里我用 root 的...
Linux服务器下Mysql自动备份脚本的使用方法 在Linux系统搭建了mysql服务,用户可以使用如下脚本实现mysql的定期备份。使用方法如下:1. 将以下脚本拷贝到本地,上传到服务器上,名称叫“autoback.sh”。#!/bin/bash#-----------------------------------------------##This is a free GNU GPL version 3.0 or abover#Copyright (C) 2008 06 05#mysql_backup Dedicated copyright by My#-----------------------------------------------#echo -e [`date +"%Y-%m-%d %H:%M:%S"`] start#system timetime=`date +"%y-%m-%d"`#host IPhost="127.0.0.1"#database backup useruser="root"#database passwordpasswd="yourpasswd"#Create a backup directorymkdir -p /backup/db/"$time"#list database nameall_database=`/usr/bin/mysql -u$user -p$passwd -Bse 'show databases'`#in the table from the database backupfor i in $all_databasedo/usr/bin/mysqldump -u$user -p$passwd $i > /backup/db/"$time"/"$i"_"$time".sqldoneecho -e ...
设置域名301重定向 301跳转通常用在网站换域名和为了保持链接统一性所用的。比如你原来的域名www.a.com现在换成www.b.com,用了301跳转后,访问www.a.com/about.html就会自动变成www.b.com/about.html 。备注:在使用301永久性重定向命令让多个域名指向网站主域名时,也不会对网站的排名产生负面影响。下面分别对不同场景下使用301跳转的设置方法进行介绍:1、IIS下301设置 Internet信息服务管理器 -> 虚拟目录 -> 重定向到URL,输入需要转向的目标URL,并选择“资源的永久重定向”。2、ASP下的301转向代码 <%@ language="VBScript"> <% Response.Status=”301 Moved Permanently” Response.AddHeader “Location”, “http://www.xxx.com/” %> 3、PHP下的301转向代码 header(”HTTP/1.1 301 Moved Permanently”); header(”Location: h...
1》修改:/etc/inittab --》启动模式改为图形启动:52》修改:/etc/gdm/custom.conf --》[xdmcp]enable=1port=1773》修改:/etc/X11/xdm/Xaccess --》* # any host can get a login window4》修改:/etc/X11/xdm/xdm-config --》DisplayManager.requestPort:0 前面加!号注释掉此行,这步必须做,然后xmanager就可以自动认出5》linux启动xdm服务 --》# xdm 启动xdm服务,启动177端口,这一步最重要# netstat -antup | grep 177 --测试开启udp 0 0 :::177 :::* 4591/xdm自动启动xdm,那么请在/etc/rc.d/rc.local文件尾部加入下边xdm的路径# which xdm/usr/bin/xdm1、配置远程桌面端口(1)如果是GDM :编辑/etc/gdm/custom.conf,内容如下:[daemon][security]AllowRemoteRoot=trueDisallowTCP=false[xdmcp]Port=177Enable=true[gui][greeter][chooser][debug][servers] 然后# gdm -restart 启动进入图形界面后必须设置允许远程连接! (2)如果是KDM:编辑/usr/share/config/kdm/Xaccess ,内容如下:#* #any host can get a login...
1,安装oracle gnome 桌面环境. yumgroupinstall -y "Desktop" "Desktop Platform" "Desktop Platform Development" "Fonts" "GeneralPurpose Desktop" "Graphical Administration Tools" "Graphics Creation Tools" "Input Methods" "X WindowSystem" "Chinese Support " "Internet Browser" # vi /etc/inittabid:5:initdefault: 然后重启系统,后再执行以下命令。yum groupinstall "Desktop"yum groupinstall "X Window System"yum groupinstall "Chinese Support" 安装完成后,再重启系统。 CentOS Starting udev: udevd[360]: GOTO 'pulseaudio_check_usb' has no matching label in: '/lib/udev/rules.d/90-pulseaudio.rules'udevd[360]: GOTO 'pulseaudio_check_usb' has no matching label in: '/lib/udev/rules.d/90-pulseaudio.rules'如果不执行,启动系统会出现不能加载桌面环境。
CENTOS6.0 KVM 虚拟化web管理安装 1安装KVM 略... 2安装 WEB管理系统 ConVirt yum install wget socat cd /etc/yum.repos.d wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo cd /root/ wget --no-cache http://www.convirture.com/downloads/convirt/2.0.1/convirt-install-2.0.1.tar.gz wget --no-cache http://www.convirture.com/downloads/convirt/2.0.1/convirt-2.0.1.tar.gz wget --no-cache http://www.convirture.com/downloads/convirture-tools/2.0.1/convirture-tools-2.0.1.tar.gz tar -xzf convirt-install-2.0.1.tar.gz cd convirt-install/install/cms/scripts/ ./install_dependencies 最好把mysql root密码改成 convirt 到后期我们可以自己改回来 Service mysqld restart source convirt-install/install/cms/scripts/install_config tar -xzf ./convirt-2.0.1.tar.gz -C $CONVIRT_BASE ./convirt-install/install/cms/scripts/setup_tg2 如果要把数...
Oracle RAC负载均衡RAC的负载均衡RAC的负载均衡主要是指新会话连接到RAC数据库时,如何判定这个新的连接要连到哪个节点进行工作。在RAC中,负载均衡分为两种,一种是基于客户端连接的,另外一种是基于服务器端的。客户端的负载均衡配置相对简单,只需要在tnsnames.ora中添加LOAD_BALANCE=ON这么一个选项即可。比如下面的TNS:RAC =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))(LOAD_BALANCE = ON)(FAILOVER = ON)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = rac)))这样当客户端连接RAC数据库时,会随机在TNS里面挑个监听地址进行连接。在Oracle10g以前,假如有节点宕机或者类似事故时,客户端可能还是选择连接到这个节点,这样会发生较长时间的TCP等待超时。而在10g以后,由于VIP和FAN的引入,这样的情况可以得到很大程度的改善。客户端的负载均衡在通常情况下能够较好地工作,但是由于连接是在客户端随机发起的,这样客户端并不知道RAC各节点的负荷及连接数情况,有可能负荷大的节点还会源源不断地增加新的连接,导致RAC节点无法均衡工作。从Oracle 10g开始,服务器端的...
CentOS下httpd增加模块 通常我们在部署LAMP时,安装完httpd服务,用我们整理的httpd.conf替换默认的httpd.conf重启httpd服务时可能会遇到某些模块未编译的情况,第一反应是要重新编译,但是apache是支持动态扩展模块的,也就是说不需要重新编译整个apache,就像的PHP phpize工具一样,能够单独编译某个扩展,并加入到已有的环境中。操作步骤:1.下载相应的httpd-x.x.xx源码2.安装扩展(以module_file_cache为例)#cd httpd-x.x.xx/modules/cache#apxs -i -a -c mod_file_cache.c3.修改配置文件一般扩展安装成功后会自动修改配置,但是需要我们确认配置文件是否配置正确,我测试在2完成之后,httpd.conf文件中自动增加了:LoadModule file_cache_module /usr/lib64/httpd/modules/mod_file_cache.so可以修改为:LoadModule file_cache_module modules/mod_file_cache.so4.重启httpd#/etc/init.d/httpd restart另外增加mod_mem_cache时提示即:#apxs -c -i mod_mem_cache.cmod_mem_cache.so: undefined symbol: cache_find其实是这样的指令:#apxs -c -i mod_mem_cache.c cache_cache.c cache_pqueue.c cache_hash.c
Centos6.5 linux解决xhost: unable to open display 实用技巧:在Linux下设置xhost方法步骤第一步:用root登陆linux,启动vnc服务;第二步:根据vnc起来的端口,设置exportDISPLAY=localhost:1(1表示vnc在第一个tty上启动的),vnc的启动信息见附件1;第三步:执行xhost +,并且提示“access controldisabled, clients can connect from any host”才正确。linux下的操作日志如下:[root@localhost ~]# vncserverNew'localhost:1 (root)' desktop is localhost:1Startingapplications specified in /root/.vnc/xstartupLog file is/root/.vnc/localhost:1.log[root@localhost ~]# exportDISPLAY=localhost:1[root@localhost ~]# xhost +accesscontrol disabled, clients can connect from anyhost 在设置xhost时,出现了unable的问题。使用上诉方法就可以搞定。
最新评论