记录关于Devops运维,虚拟化容器云计算,数据库,网络安全等各方面问题。
安装配置Varnish3.0手记 在内网的vps上安装Varnish的最新版3.0来用做测试Varnish有centos下的rpm和ubuntu下的deb二进制包下载,但我选择的是源码编译安装先下载 wget http://repo.varnish-cache.org/source/varnish-3.0.0.tar.gztar -xzvf varnish-3.0.0.tar.gz yum install gcc yum install gcc-c++ libstdc++-develyum install -y httpd-devel pcre perl pcre-devel zlib zlib-devel GeoIP GeoIP-devel Varnish需要pcre支持,如果服务器没有安装pcre-devel会提示需要指定prce目录。Centos服务器上使用yum install pcre-devel安装 解压varnish进行编译安装cd varnish-3.0.0./autogen.sh./configure --prefix=/usr/local/varnish PKG_CONFIG_PATH=/usr/lib/pkgconfig makemake install安装成功后,安装的目录是cd /usr/local/varnish/sbin./varnishd -V 查看版本,看是否安装成功测试varnish先编辑配置文件vi /usr/local/varnish/etc/varnish/default.vcl # This is a basic VCL configuration file for varnish. See the vcl(7)# man page for ...
varnish-3.0.2 安装配置文件 varnish的介绍很多,这里就不做过多的说明,直接贴上我的安装及配置方法,希望会对大家有用,仅供参考安装方法如下: wget -S http://repo.varnish-cache.org/source/varnish-3.0.2.tar.gz
tar zxvf varnish-3.0.2.tar.gz
cd varnish-3.0.2
./configure --prefix=/usr/local/varnish --enable-dependency-trackin --enable-debugging-symbols --enable-developer-warnings
make
make install
varnish No package 'libpcre' found
说是缺少 pcre。我安装nginx的时候用到了pcre 安装了的
使用以下办法
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig backend www {
.host = "127.0.0.1";
.port = "80";
}
backend blog {
.host = "127.0.0.1";
.port = "80";
}
director webbeta round-robin {
{.backend=www;}
{.backend=blog;}
}
acl purge {
"127.0.0.1";
"localhost";
}
sub vcl_recv
{
if (req...
Linux Shell删除一个目录下所有的文件夹
#!/bin/bash
direc=$(pwd)
for dir2del in $direc/* ; do
if [ -d $dir2del ]; then
rm -rf $dir2del
fi
done
如何查看Oracle数据库实例状态?set oracle_sid=你要查询的实例service名称
sqlplus / as sysdba
SQL>select status from v$instance; 01show sga02 03set wrap off04set linesize 40005-- 查看正在运行的后台进程06select * from v$bgprocess;07select * from v$bgprocess where paddr<>'00';08 09--查看数据库的物理组成:文件情况10select * from v$controlfile;11select * from v$datafile;12select * from v$logfile;13 14--查看实例内存情况15show parameter sga16show parameter shared17show parameter db_cache18show parameter log19 20alter system set db_cache_size=64m; //可以动态修改sga中内存区的大小,但是不能超过sga的最大内存21 22select * from dept;23 24--表空间管理25CREATE TABLESPACE tbs226DATAFILE 'D:\oracle\oradata\APTECH\tbs2_01.dbf'27SIZE 50M;28 29conn sys/admin as sysdba(重启数据库必须以sys用户登陆)30 31shutdown immediate(关闭数据库)32启动数据库的三个步骤:33startup nomount (启动实例)34alter database mount;(装载数据库,读取控制文件)35alter databas...
Upgrade VMware ESXi 5.1 to ESXi 5.5 on a Gigabyte Brix using esxcliLeave a reply BackgroundBetween ESX 5.1 and ESXi 5.5, VMware removed the bundled driver for the Realtek RTL8111E NIC, which is embedded in the Gigabyte Brix.This means that if you try to boot a normal ESXi 5.5 installer, it won’t find the NIC driver and will refuse to install/upgrade your ESXi 5.1 instance.How to upgradeTo get around this limitation, you can do one of two things:Upgrade by creating an ESXi 5.5 install ISO that includes the net-r8168 driver packageUpgrade directly via the esxcli command-line (which is what this guide covers)Upgrading via the command linePre-requisitesIf you want to do this remotely, you’ll need to enable SSH on the Brix. You can do this via the console, or if you run your Brix headless, you can do it via PowerCLI with these commands:$esxihost="YourEsxiServerHostName"
Connect-viserver $esxihost
Start-VMHostService -HostService (Get-VMHost -Name $esxihost | Get-VMHostServ...
Installing VMware ESXi 5.5 on the Gigabyte Brix ScopeThis article covers the steps required to install VMware ESXi 5.5 on the Gigabyte Brix, and a few other systems that use non-supported NICs that worked in ESXi 5.1.BackgroundThe driver for the Realtek RTL8111E gigabit NIC was included in the default ESXi 5.1 install ISO. Sadly, with the release of ESXi 5.5, the driver is no longer included, so we have to add it ourselves.The good news is that this is fairly easy, and should also allow anyone with an RTL8111 NIC or a RTL8168 NIC to install VMware ESXi 5.5 successfully. I can confirm it works on the Gigabyte Brix.Pre-requisitesYou will need PowerCLI 5.5StepsHere’s what I did, using PowerCLI:Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
New-EsxImageProfile -CloneProfile "ESXi-5.5.0-1331820-standard" -name "ESXi-5.5.0-1331820-GigabyteBrix" -Vendor "TwistedEthics.com"
Add-EsxSoftwarePackage -ImagePr...
Squid 2.6 2.7 3.0 3.1 以及 varnish 2.1.5 性能对比测试 感谢 xyy运营团队 总结说明: 使用压力测试软件siege,http_load对这几个代理软件进行测试,测试了不同大小的文件和各种并发数。 squid的版本选择,考虑到实际使用的一些需求,并参考了其他的一些文章(比如:http://www.php-oa.com/2009/12/02/cache%e8%bd%af%e4%bb%b6%e7%89%88%e6%9c%ac%e9%80%89%e6%8b%a9.html),没有选择比较老的squid 2.5。 每次测试前清除文件缓存并重启代理软件。 这个测试仅作为数据参考,并不能完全模拟生产环境那么复杂的网络请求(请求数,各种大小的文件请求)。 一、测试环境: 硬件:Intel Xeon E5410 @ 2.33GHz * 2,16G内存,SATA 500G * 4(RAID 10) 安装squid 2.7 ./configure -prefix=/opt/squid2.7 -enable-xmalloc-statistics --enable-async-io=320 --with-maxfd=65536 -enable-useragent-log -enable-referer-log -enable-epoll -disable-poll -enable-large-cache-files -disable-internal-dns -enable-linux-netfilter -enable-truncate -enable-x-accelerator-vary -enable-follow-x-f...
http_load 对squid 进行压力测试 本次压力测试的目的: a. 查看单个squid 的在大量的url 访问时 Cache 命中率 b. 在此过程中,查看squid 的平均响应时间 c. 查看 cpu mem io 的瓶颈http_load 的配置安装, 网上很多,这里就不多话了在一台服务器上搭建一个回源webservice (这里用apache 要记得设置cache-control),将 域名 cdnxxx.com指向该台服务器的IP在cdnxxx.com的根目录 生成大量测试的小图片(因为主要是测试cache、热点命中率,所以图片一般小于35KB),准备20个jpg 小图片 放到src文件夹中,将src 拷贝到cdnxxx.com的根目录,在根目录创建0文件夹(mkdir 0) a. 生成代码,用python写的,先在0这个目录下生成6000个jpg图片 '''Created on 2013-7-16 @author: xie''' #!/usr/bin/pythonimport string, random, os # create uri def UriTotal(): uri_total = 6000 dir_total = 20  ...
TIME_WAIT 问题及netstat状态描述1,netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}'会得到类似下面的结果,具体数字会有所不同:LAST_ACK 1SYN_RECV 14ESTABLISHED 79FIN_WAIT1 28FIN_WAIT2 3CLOSING 5TIME_WAIT 1669状态:描述CLOSED:无连接是活动的或正在进行LISTEN:服务器在等待进入呼叫SYN_RECV:一个连接请求已经到达,等待确认SYN_SENT:应用已经开始,打开一个连接ESTABLISHED:正常数据传输状态FIN_WAIT1:应用说它已经完成FIN_WAIT2:另一边已同意释放ITMED_WAIT:等待所有分组死掉CLOSING:两边同时尝试关闭TIME_WAIT:另一边已初始化一个释放LAST_ACK:等待所有分组死掉也就是说,这条命令可以把当前系统的网络连接状态分类汇总。inux下高并发的Squid服务器,TCP TIME_WAIT套接字数量经常达到两、三万,
服务器很容易被拖死。通过修改Linux内核参数,可以减少服务器的IME_WAIT套接字数量。
vi /etc/sysctl.conf
增加以下几行:
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_syncookies =&nb...
Squid动态URL日志不完整的问题 问题:当访问的URL为:http://cdnfox.com/xxx.php?sig=xxxxxxx时:日志为:1376378941 0 10.0.0.10 GET "http://cdnfox.com/xxx.php?"/1.1 - "image/jpeg" "curl/7.27.0" "-" TCP_MEM_HIT:NONE/- 200 21753URL后面的:sig=xxxxxxx 丢失了。解决方法:在squid.conf中添加:strip_query_terms off重新reload squid,日志正常。strip_query_terms默认为开启。是为了保护用户的隐私,而不在日志中记录“?”后面的参数。
最新评论