memcache搭建
memcache搭建步骤:
个人原创,允许转载,请注明出处,作者,否则追究法律责任。
0.1 memcache的服务端
0.2 mysql的服务端
0.3 memcache 的客户端:lamp架构
1,环境搭建:
memcache的安装包
if地址
yum源
三关
yum - y install gcc*
2,先配置0.3上的lamp架构:
yum -y install httpd mysql-server mysql
82 service httpd restart
83 cd /root/桌面/
84 ls
85 cp memcache.zip /tmp
86 cd /tmp/
87 ls
88 unzip memcache.zip
89 ls
90 cd memcache
91 ls
94 cp memcache-2.2.7.tgz /usr/src/
95 scp memcached-1.4.22.tar.gz libevent-2.0.22-stable.tar.gz root@10.0.0.1:/tmp
96 ls
97 cd php/
98 ls
99 rm -rf php-devel-5.3.2-6.el6.x86_64.rpm
100 rm -rf php-devel-5.3.3-23.el6_4.x86_64.rpm
101 ls
102 cd /usr/src/
103 ls
108 tar fx memcache-2.2.7.tgz
109 ls
110 cd memcache-2.2.7
111 ls
112 cd -
113 ls
114 cd /tmp/memcache/php/
115 ls
117 yum -y localinstall ./*
118 yum -y localinstall --skip-broken ./*
119 cd /usr/src/
120 ls
121 cd memcache-2.2.7
122 phpize
123 ls
124 ./configure --enable-memcache --with-php-config=/usr/bin/php-config
125 make
126 make install
127 ls /usr/lib64/php/modules/
128 vim /etc/php.ini
末行添加:extension=memcache.so
129 php -m (检查下有没有memcache的模块:memcache.so)
3,配置0.1上的memcache的服务端
cd /tmp
54 ls
55 tar fx libevent-2.0.22-stable.tar.gz
56 ls
57 cd libevent-2.0.22-stable
58 ls
59 ./configure --prefix=/usr/local/libevent
81 make && make install
82 cd ..
83 ls
84 tar fx memcached-1.4.22.tar.gz
85 ls
86 cd memcached-1.4.22
87 ls
88 ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent
89 make
91 make install
92 /usr/local/memcached/bin/memcached -u root -p 11211 -l 10.0.0.1 -P /var/run/messagebus.pid -m 128m -c 2048 -d (启动memcache)
[root@localhost memcached-1.4.22]# /usr/local/memcached/bin/memcached -u root -p 11211 -l 10.0.0.1 -P /var/run/messagebus.pid -m 128m -c 2048 -d
[root@localhost memcached-1.4.22]# yum -y install lsof
已加载插件:product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
设置安装进程
包 lsof-4.82-5.el6.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost memcached-1.4.22]# lsof -i :11211
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
memcached 14715 root 26u IPv4 43374 0t0 TCP 10.0.0.1:memcache (LISTEN)
memcached 14715 root 27u IPv4 43376 0t0 UDP 10.0.0.1:memcache
memcached 14715 root 28u IPv4 43376 0t0 UDP 10.0.0.1:memcache
memcached 14715 root 29u IPv4 43376 0t0 UDP 10.0.0.1:memcache
memcached 14715 root 30u IPv4 43376 0t0 UDP 10.0.0.1:memcache
[root@localhost memcached-1.4.22]# ps aux |grep memcache
root 14715 0.0 0.2 326916 1140 ? Ssl 14:59 0:00 /usr/local/memcached/bin/memcached -u root -p 11211 -l 10.0.0.1 -P /var/run/messagebus.pid -m 128m -c 2048 -d
root 14728 0.0 0.1 103324 876 pts/0 S+ 14:59 0:00 grep memcache
[root@localhost memcached-1.4.22]# yum -y install telnet
[root@localhost memcached-1.4.22]# telnet 10.0.0.3 80
Trying 10.0.0.3...
Connected to 10.0.0.3.
Escape character is '^]'.
set name 0 60 5
vfast
STORED
get name
stats
4,0.2 安装MySQL服务端
yum -y intall mysql mysql-server
[root@localhost yum.repos.d]# service mysqld start
[root@localhost yum.repos.d]# mysql
...
mysql> grant all on *.* to root@'%' identified by '123';
Query OK, 0 rows affected (0.00 sec)
mysql> select user,password,host from mysql.user;
+------+-------------------------------------------+-----------------------+
| user | password | host |
+------+-------------------------------------------+-----------------------+
| root | | localhost |
| root | | localhost.localdomain |
| root | | 127.0.0.1 |
| | | localhost |
| | | localhost.localdomain |
| root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 | % |
+------+-------------------------------------------+-----------------------+
6 rows in set (0.00 sec)
mysql> exit
memcache搭建的更多相关文章
- windows下memcache扩展安装和搭建
### windows下memcache扩展安装和搭建 背景:在做微信公众号的开发时,token的有效期为7200秒,所以需要对token进行保存,在这选择了memcache作为缓存工具 memcac ...
- 搭建LNAMP环境(七)- PHP7源码安装Memcached和Memcache拓展
上一篇:搭建LNAMP环境(六)- PHP7源码安装MongoDB和MongoDB拓展 一.安装Memcached 1.yum安装libevent事件触发管理器 yum -y install libe ...
- 自己动手搭建Nginx+memcache+xdebug+php运行环境绿色版 For windows版
Nginx比apache要好,优点很多,随便去搜寻引擎找一下就能找到一大把资料,这不是我们讨论的重点,我们的重点是自己做一个运行组合! 為何我不從網上下載一個別人已經封裝好的現成的版本呢?因為 ...
- nginx+apache+mysql+php+memcache+squid搭建集群web环境
服务器的大用户量的承载方案 一.前言 二.编译安装 三. 安装MySQL.memcache 四. 安装Apache.PHP.eAccelerator.php-memcache 五. 安装Squid 六 ...
- Memcache服务搭建
Memcache Memcache的作用网上资料都讲的很好,说简单点就是减轻读取数据库的压力,原理也很简单: 被请求的数据会先到memcache里去取,如果没有就去数据库里取,顺便给memcache带 ...
- MemCache在Windows环境下的搭建及启动
MemCache在Windows环境下的搭建及启动 一.memcache服务器端的安装 1.下载memcached的安装包,memcached_en32or64.zip,下载链接:http://pan ...
- MemCache在Windows下环境的搭建及启动
sc create "memcached-11212" start= auto binPath= "D:\memcached_en32or64\x64\memcached ...
- 基于源码编译的lnmp架构实现论坛的搭建及memcache的应用
系统环境: RHEL6 x86-64 selinux and iptables disabled LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构 Linux是一类 ...
- LNMP环境搭建配置memcache
原始出处 http://iceeggplant.blog.51cto.com/1446843/819576 memcached是高性能的,分布式的内存对象缓存系统,在动态应用中减少数据库负载,提升访 ...
随机推荐
- ACM==迷茫
写给迷茫的自己~~ 从家里来学校一周多了,没做几个题,也没学习新的算法,就这样迷茫地无所事事.有时我就在想我是不是真的喜欢算法?曾经自己定下的竞赛目标要置之不理吗? 我高中毕业于一个普通高中,在上大学 ...
- SpringBoot,Security4, redis共享session,分布式SESSION并发控制,同账号只能登录一次
由于集成了spring session ,redis 共享session,导致SpringSecurity单节点的session并发控制失效, springSession 号称 无缝整合httpses ...
- CentOS下iptables持久化
iptables规则持久化 设定防火墙规则 iptables -A INPUT -s 1.1.1.1/32 -p tcp -m tcp --dport 22 -j DROP iptables -A I ...
- Lua Table转C# Dictionary
因为在游戏公司做web后台开发,经常会涉及到取游戏服务器的数据库里面读写各种操作. 昨天下午,服务器那边让我读一个配置显示到后台,让运营大佬们可以在web后台配置游戏参数. 本来以为很简单个事情,结果 ...
- FMECA分析
FMECA是针对产品所有可能的故障,并根据对故障模式的分析,确定每种故障模式对产品工作的影响,找出单点故障,并按故障模式的严重度及其发生概率确定其危害性.所谓单点故障指的是引起产品故障的,且没有冗余或 ...
- 【php】windows安装PHP5.5+Apache2.4
php5.5和apache2.4的整合 看到php的版本升级了,就想试下新的特性 一.准备下载的文件 apache2.4.9 http://www.apachelounge.com/download/
- Flex上传文件报“Error #2038”
1.错误描述 ioerror: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 t ...
- js 数组去重常见的几种方式
1.利用标记 var arr = [2,6,2,6,4,3,16];// arr = [2,6,4,3,16] function norepeat(arr){ var res = []; for(va ...
- 数列分块总结——题目总版(hzwer分块九题及其他题目)(分块)
闲话 莫队算法似乎还是需要一点分块思想的......于是我就先来搞分块啦! 膜拜hzwer学长神犇%%%Orz 这九道题,每一道都堪称经典,强力打Call!点这里进入 算法简述 每一次考试被炸得体无完 ...
- Codeforces Round #467 (div.2)
Codeforces Round #467 (div.2) 我才不会打这种比赛呢 (其实本来打算打的) 谁叫它推迟到了\(00:05\) 我爱睡觉 题解 A. Olympiad 翻译 给你若干人的成绩 ...