Home

docker配置lnmp

mac还要注意做端口映射要先开启 VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port5000,tcp,,5000,,5000"; 基于centos的镜像开始 由于是最小安装很多都没有,先安装基本的工具 yum install net-tools yum -y install wget yum -y install vim yum install gcc-c++ yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl--devel ...

Read more

Memcached集群

方案 memcached没有自带官方集群方案,需要使用第三方,主流keepalived+magent+memcache, magent magent代理访问,他根据hash算法,得到key存储的后端机器,请求memcache得到数据,keepalived保证magent高可用 具体查找过程   采用的是一致性hash,首先求出memcached服务器(节点)的哈希值, 并将其配置到0~232的圆(continuum)上。 然后用同样的方法求出存储数据的键的哈希值,并映射到圆上。 然后从数据映射到的位置开始顺时针查找,将数据保存到找到的第一个服务器上。 如果超过232仍然找不到服务器,就会保存到第一台memcached服务器上。 实践 三步走安装好magent和memcac...

Read more

go环境编译

1.获取源码 git clone https://github.com/golang/go.git 2.编译1.4版本 进入src,执行all.bash 配置$GOROOT_BOOTSTRAP 3.切换到1.6版本 进入src,执行all.bash 配置$GOPATH ,OK,搞定

Read more

varnish使用

是什么 一款高性能的开源HTTP加速器,说人话就是反向代理服务器,缓存服务器,利用内存文件映射把静态资源缓存了,提高性能,由于它是后面出来的会比squid设计好,性能高 VCL 为了方便配置,整了个配置语言vcl,不过多赘述,给个网上例子 #配置两个后端服务器 backend web1 { .host = "172.25.79.2"; .port = "80"; } backend web2 { .host = "172.25.79.3"; .port = "80"; } ##把两个后端聚合为一个组,并检测后端健康状况 director lb round-robin { { .backend = web1; } { .backend = web2; } } su...

Read more

gnuplot使用

安装: ubuntu:apt-get install gnuplot 之后在安装x11 centos: yum install gnuplot 运行方式两种: 1.进入gnuplot命令行终端 2.gnuplot xxx.conf ,直接执行相应配置语句,加上-persist不会一闪而过。 总结和python类似 基本语句: set size 0.5, 0.5 set term png size 600, 400 1、plot命令 gnuplot> plot sin(x) with line linetype 3 linewidth 2 或 gnuplot> plot sin(x) w l lt 3 lw 2 %用线画,线的类型(包括颜色与虚线的类...

Read more

sysbench使用

是什么 sysbench是一个模块化的、跨平台、多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况。 它主要包括以下几种方式的测试: 1、cpu性能 2、磁盘io性能 3、调度程序性能 4、内存分配及传输速度 5、POSIX线程性能 6、数据库性能(OLTP基准测试) 目前sysbench主要支持 MySQL,pgsql,oracle 这3种数据库 使用 root@lh:/usr/local/apache/htdocs# sysbench Missing required command argument. Usage: sysbench [general-options]... --test=<test-name> [test-optio...

Read more