实践案例 <中小型Web架构>3 Memcached配置管理

本章节参考《SaltStack技术入门与实践》,感谢该书作者: 刘继伟、沈灿、赵舜东

Memcached介绍

  Memcached是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态数据库驱动网站的访问速度。Memcached基于一个存储键/值对的hashmap。其守护进程(daemon )是用C写的,但是客户端可以用任何语言来编写,并通过memcached协议与守护进程通信。我们这个架构案例使用Memcached来存储用户的session。

  我们经常会在负载均衡的环境下遇到Session问题,一般的解决办法有三种:

  • Session保持。
  • Session复制。
  • Session共享。

  PHP可以很容易在php.ini配置中将Session存储在Memcached中,来实现Session共享,这样后端服务器有节点down机,用户的访问请求被调度到集群中的其他节点时,用户的会话也不会丢失。

  Memcached的安装比较简单。首先Memcached依赖于libevent,所以需要先编译安装libevent,然后编译安装Memcached。后面我们在PHP配置管理中编写php-memcached的模块。同时还需要创建一个管理用户的配置,Memcached包括后面要配置的Nginx和PHP,都要使用www用户进行管理。

  首先创建目录结构如下:

  1. [root@SaltMaster1(10.182.88.136)]$~:>mkdir -pv /srv/salt/prod/libevent/files
  2. [root@SaltMaster1(10.182.88.136)]$~:>mkdir -pv /srv/salt/prod/memcached/files
  3. [root@SaltMaster1(10.182.88.136)]$~:>mkdir -pv /srv/salt/prod/user

www用户配置

  启动Memcached需要使用www用户,包括后面我们不熟Nginx和PHP都需要使用到www用户。所以我们把www用户的配置单独放置在user目录下:

  1. [root@SaltMaster1(10.182.88.136)]$~:>more /srv/salt/prod/user/www.sls
  2. www-user-group:
  3. group.present:
  4. - name: www
  5. - gid:
  6.  
  7. user.present:
  8. - name: www
  9. - fullname: www
  10. - shell: /sbin/nologin
  11. - uid:
  12. - gid:

  后期在需要使用到www用户的地方,将www.sls包含进去即可。

libevent配置

下载源码包:

  1. [root@SaltMaster1(10.182.88.136)]$~:>cd /srv/salt/prod/libevent/files/
  2. [root@SaltMaster1(10.182.88.136)]$files:>wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
  3. ---- ::-- https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
  4. Resolving github.com... 13.250.177.223, 13.229.188.59, 52.74.223.119
  5. Connecting to github.com|13.250.177.223|:... connected.
  6. HTTP request sent, awaiting response... Found
  7. Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/1856976/f9ea6922-e66b-11e6-9f5c-722c00daa657?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180703%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180703T085111Z&X-Amz-Expires=300&X-Amz-Signature=a7bd7bb09111081bf8a092e48f296a39493cc7f95809c0a259711e060aa44aed&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dlibevent-2.1.8-stable.tar.gz&response-content-type=application%2Foctet-stream [following]
  8. ---- ::-- https://github-production-release-asset-2e65be.s3.amazonaws.com/1856976/f9ea6922-e66b-11e6-9f5c-722c00daa657?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180703%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180703T085111Z&X-Amz-Expires=300&X-Amz-Signature=a7bd7bb09111081bf8a092e48f296a39493cc7f95809c0a259711e060aa44aed&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dlibevent-2.1.8-stable.tar.gz&response-content-type=application%2Foctet-stream
  9. Resolving github-production-release-asset-2e65be.s3.amazonaws.com... 52.216.128.35
  10. Connecting to github-production-release-asset-2e65be.s3.amazonaws.com|52.216.128.35|:... connected.
  11. HTTP request sent, awaiting response... OK
  12. Length: (1002K) [application/octet-stream]
  13. Saving to: `libevent-2.1.-stable.tar.gz'
  14.  
  15. %[==================================================================================================================================================================================================>] ,, 357K/s in .8s
  16.  
  17. -- :: ( KB/s) - `libevent-2.1.-stable.tar.gz' saved [1026485/1026485]

编写libevent部署SLS如下:

  1. [root@SaltMaster1(10.182.88.136)]$libevent:>more install.sls
  2. libevent-source-install:
  3. file.managed:
  4. - name: /tmp/libevent-2.1.-stable.tar.gz
  5. - source: salt://libevent/files/libevent-2.1.8-stable.tar.gz
  6. - user: root
  7. - group: root
  8. - mode:
  9. cmd.run:
  10. - name: cd /tmp/ && tar -zxf libevent-2.1.-stable.tar.gz && cd libevent-2.1.-stable && ./configure --prefix/export/servers/libevent-2.1. && make && make install
  11. - unless: test -d /usr/local/libevent
  12. - require:
  13. - file: libevent-source-install

执行状态模块

  1. [root@SaltMaster1(10.182.88.136)]$prod:>salt '10.182.76.78' state.highstate
  2. 10.182.76.78:
  3. ----------
  4. ID: /etc/resolv.conf
  5. Function: file.managed
  6. Result: True
  7. Comment: File /etc/resolv.conf is in the correct state
  8. Started: ::10.713289
  9. Duration: 43.146 ms
  10. Changes:
  11. ----------
  12. ID: /etc/profile
  13. Function: file.append
  14. Result: True
  15. Comment: File /etc/profile is in correct state
  16. Started: ::10.756701
  17. Duration: 4.649 ms
  18. Changes:
  19. ----------
  20. ID: /etc/bashrc
  21. Function: file.append
  22. Result: True
  23. Comment: File /etc/bashrc is in correct state
  24. Started: ::10.761555
  25. Duration: 4.932 ms
  26. Changes:
  27. ----------
  28. ID: net.ipv4.ip_forward
  29. Function: sysctl.present
  30. Result: True
  31. Comment: Sysctl value net.ipv4.ip_forward = is already set
  32. Started: ::10.768589
  33. Duration: 168.841 ms
  34. Changes:
  35. ----------
  36. ID: net.ipv4.conf.default.rp_filter
  37. Function: sysctl.present
  38. Result: True
  39. Comment: Sysctl value net.ipv4.conf.default.rp_filter = is already set
  40. Started: ::10.937904
  41. Duration: 164.89 ms
  42. Changes:
  43. ----------
  44. ID: net.ipv4.conf.default.accept_source_route
  45. Function: sysctl.present
  46. Result: True
  47. Comment: Sysctl value net.ipv4.conf.default.accept_source_route = is already set
  48. Started: ::11.103150
  49. Duration: 165.103 ms
  50. Changes:
  51. ----------
  52. ID: kernel.sysrq
  53. Function: sysctl.present
  54. Result: True
  55. Comment: Sysctl value kernel.sysrq = is already set
  56. Started: ::11.268613
  57. Duration: 164.378 ms
  58. Changes:
  59. ----------
  60. ID: kernel.core_uses_pid
  61. Function: sysctl.present
  62. Result: True
  63. Comment: Sysctl value kernel.core_uses_pid = is already set
  64. Started: ::11.433337
  65. Duration: 164.071 ms
  66. Changes:
  67. ----------
  68. ID: kernel.msgmnb
  69. Function: sysctl.present
  70. Result: True
  71. Comment: Sysctl value kernel.msgmnb = is already set
  72. Started: ::11.597731
  73. Duration: 164.621 ms
  74. Changes:
  75. ----------
  76. ID: kernel.msgmax
  77. Function: sysctl.present
  78. Result: True
  79. Comment: Sysctl value kernel.msgmax = is already set
  80. Started: ::11.762714
  81. Duration: 163.28 ms
  82. Changes:
  83. ----------
  84. ID: kernel.shmmax
  85. Function: sysctl.present
  86. Result: True
  87. Comment: Sysctl value kernel.shmmax = is already set
  88. Started: ::11.926318
  89. Duration: 163.713 ms
  90. Changes:
  91. ----------
  92. ID: kernel.shmall
  93. Function: sysctl.present
  94. Result: True
  95. Comment: Sysctl value kernel.shmall = is already set
  96. Started: ::12.090393
  97. Duration: 163.292 ms
  98. Changes:
  99. ----------
  100. ID: yum_repo_release
  101. Function: pkg.installed
  102. Result: True
  103. Comment: All specified packages are already installed
  104. Started: ::13.307564
  105. Duration: 2438.915 ms
  106. Changes:
  107. ----------
  108. ID: zabbix_repo_release
  109. Function: pkg.installed
  110. Result: True
  111. Comment: All specified packages are already installed
  112. Started: ::15.746854
  113. Duration: 816.17 ms
  114. Changes:
  115. ----------
  116. ID: libevent-source-install
  117. Function: file.managed
  118. Name: /tmp/libevent-2.1.-stable.tar.gz
  119. Result: True
  120. Comment: File /tmp/libevent-2.1.-stable.tar.gz is in the correct state
  121. Started: ::16.563350
  122. Duration: 56.331 ms
  123. Changes:
  124. ----------
  125. ID: libevent-source-install
  126. Function: cmd.run
  127. Name: cd /tmp/ && tar -zxf libevent-2.1.-stable.tar.gz && cd libevent-2.1.-stable && ./configure --prefix=/export/servers/libevent-2.1. && make && make install
  128. Result: True
  129. Comment: Command "cd /tmp/ && tar -zxf libevent-2.1.8-stable.tar.gz && cd libevent-2.1.8-stable && ./configure --prefix=/export/servers/libevent-2.1.8 && make && make install" run
  130. Started: ::16.620610
  131. Duration: 55072.186 ms
  132. Changes:
  133. ----------
  134. pid:
  135.  
  136. retcode:
  137.  
  138. stderr:
  139. File "./test/../event_rpcgen.py", line
  140. print s
  141. ^
  142. SyntaxError: Missing parentheses in call to 'print'. Did you mean print(s)?
  143. event_rpcgen.py failed, ./test/regress.gen.\[ch\] will be reused.
  144. stdout:
  145. checking for a BSD-compatible install... /usr/bin/install -c
  146. checking whether build environment is sane... yes
  147. checking for a thread-safe mkdir -p... /bin/mkdir -p
  148. checking for gawk... gawk
  149. checking whether make sets $(MAKE)... yes
  150. checking whether make supports nested variables... yes
  151. checking whether make supports nested variables... (cached) yes
  152. checking for style of include used by make... GNU
  153. checking for gcc... gcc
  154. checking whether the C compiler works... yes
  155. checking for C compiler default output file name... a.out
  156. checking for suffix of executables...
  157. checking whether we are cross compiling... no
  158. checking for suffix of object files... o
  159. checking whether we are using the GNU C compiler... yes
  160. checking whether gcc accepts -g... yes
  161. checking for gcc option to accept ISO C89... none needed
  162. checking whether gcc understands -c and -o together... yes
  163. checking dependency style of gcc... gcc3
  164. checking how to run the C preprocessor... gcc -E
  165. checking for grep that handles long lines and -e... /bin/grep
  166. checking for egrep... /bin/grep -E
  167. checking for ANSI C header files... yes
  168. checking for sys/types.h... yes
  169. checking for sys/stat.h... yes
  170. checking for stdlib.h... yes
  171. checking for string.h... yes
  172. checking for memory.h... yes
  173. checking for strings.h... yes
  174. checking for inttypes.h... yes
  175. checking for stdint.h... yes
  176. checking for unistd.h... yes
  177. checking minix/config.h usability... no
  178. checking minix/config.h presence... no
  179. checking for minix/config.h... no
  180. checking whether it is safe to define __EXTENSIONS__... yes
  181. checking build system type... x86_64-unknown-linux-gnu
  182. checking host system type... x86_64-unknown-linux-gnu
  183. checking whether ln -s works... yes
  184. checking for a sed that does not truncate output... /bin/sed
  185. checking whether gcc needs -traditional... no
  186. checking how to print strings... printf
  187. checking for a sed that does not truncate output... (cached) /bin/sed
  188. checking for fgrep... /bin/grep -F
  189. checking for ld used by gcc... /usr/bin/ld
  190. checking if the linker (/usr/bin/ld) is GNU ld... yes
  191. checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
  192. checking the name lister (/usr/bin/nm -B) interface... BSD nm
  193. checking the maximum length of command line arguments...
  194. checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
  195. checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
  196. checking for /usr/bin/ld option to reload object files... -r
  197. checking for objdump... objdump
  198. checking how to recognize dependent libraries... pass_all
  199. checking for dlltool... no
  200. checking how to associate runtime and link libraries... printf %s\n
  201. checking for ar... ar
  202. checking for archiver @FILE support... @
  203. checking for strip... strip
  204. checking for ranlib... ranlib
  205. checking command to parse /usr/bin/nm -B output from gcc object... ok
  206. checking for sysroot... no
  207. checking for a working dd... /bin/dd
  208. checking how to truncate binary pipes... /bin/dd bs= count=
  209. checking for mt... no
  210. checking if : is a manifest tool... no
  211. checking for dlfcn.h... yes
  212. checking for objdir... .libs
  213. checking if gcc supports -fno-rtti -fno-exceptions... no
  214. checking for gcc option to produce PIC... -fPIC -DPIC
  215. checking if gcc PIC flag -fPIC -DPIC works... yes
  216. checking if gcc static flag -static works... no
  217. checking if gcc supports -c -o file.o... yes
  218. checking if gcc supports -c -o file.o... (cached) yes
  219. checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
  220. checking whether -lc should be explicitly linked in... no
  221. checking dynamic linker characteristics... GNU/Linux ld.so
  222. checking how to hardcode library paths into programs... immediate
  223. checking whether stripping libraries is possible... yes
  224. checking if libtool supports shared libraries... yes
  225. checking whether to build shared libraries... yes
  226. checking whether to build static libraries... yes
  227. checking for library containing inet_ntoa... none required
  228. checking for library containing socket... none required
  229. checking for library containing inet_aton... none required
  230. checking for library containing clock_gettime... -lrt
  231. checking for clock_gettime... yes
  232. checking for library containing sendfile... none required
  233. checking for WIN32... no
  234. checking for CYGWIN... no
  235. checking zlib.h usability... yes
  236. checking zlib.h presence... yes
  237. checking for zlib.h... yes
  238. checking for library containing inflateEnd... -lz
  239. checking for special C compiler options needed for large files... no
  240. checking for _FILE_OFFSET_BITS value needed for large files... no
  241. checking for pkg-config... /usr/bin/pkg-config
  242. checking if pkg-config is at least version 0.15.... yes
  243. checking arpa/inet.h usability... yes
  244. checking arpa/inet.h presence... yes
  245. checking for arpa/inet.h... yes
  246. checking fcntl.h usability... yes
  247. checking fcntl.h presence... yes
  248. checking for fcntl.h... yes
  249. checking ifaddrs.h usability... yes
  250. checking ifaddrs.h presence... yes
  251. checking for ifaddrs.h... yes
  252. checking mach/mach_time.h usability... no
  253. checking mach/mach_time.h presence... no
  254. checking for mach/mach_time.h... no
  255. checking netdb.h usability... yes
  256. checking netdb.h presence... yes
  257. checking for netdb.h... yes
  258. checking netinet/in.h usability... yes
  259. checking netinet/in.h presence... yes
  260. checking for netinet/in.h... yes
  261. checking netinet/in6.h usability... no
  262. checking netinet/in6.h presence... no
  263. checking for netinet/in6.h... no
  264. checking netinet/tcp.h usability... yes
  265. checking netinet/tcp.h presence... yes
  266. checking for netinet/tcp.h... yes
  267. checking poll.h usability... yes
  268. checking poll.h presence... yes
  269. checking for poll.h... yes
  270. checking port.h usability... no
  271. checking port.h presence... no
  272. checking for port.h... no
  273. checking stdarg.h usability... yes
  274. checking stdarg.h presence... yes
  275. checking for stdarg.h... yes
  276. checking stddef.h usability... yes
  277. checking stddef.h presence... yes
  278. checking for stddef.h... yes
  279. checking sys/devpoll.h usability... no
  280. checking sys/devpoll.h presence... no
  281. checking for sys/devpoll.h... no
  282. checking sys/epoll.h usability... yes
  283. checking sys/epoll.h presence... yes
  284. checking for sys/epoll.h... yes
  285. checking sys/event.h usability... no
  286. checking sys/event.h presence... no
  287. checking for sys/event.h... no
  288. checking sys/eventfd.h usability... yes
  289. checking sys/eventfd.h presence... yes
  290. checking for sys/eventfd.h... yes
  291. checking sys/ioctl.h usability... yes
  292. checking sys/ioctl.h presence... yes
  293. checking for sys/ioctl.h... yes
  294. checking sys/mman.h usability... yes
  295. checking sys/mman.h presence... yes
  296. checking for sys/mman.h... yes
  297. checking sys/param.h usability... yes
  298. checking sys/param.h presence... yes
  299. checking for sys/param.h... yes
  300. checking sys/queue.h usability... yes
  301. checking sys/queue.h presence... yes
  302. checking for sys/queue.h... yes
  303. checking sys/resource.h usability... yes
  304. checking sys/resource.h presence... yes
  305. checking for sys/resource.h... yes
  306. checking sys/select.h usability... yes
  307. checking sys/select.h presence... yes
  308. checking for sys/select.h... yes
  309. checking sys/sendfile.h usability... yes
  310. checking sys/sendfile.h presence... yes
  311. checking for sys/sendfile.h... yes
  312. checking sys/socket.h usability... yes
  313. checking sys/socket.h presence... yes
  314. checking for sys/socket.h... yes
  315. checking for sys/stat.h... (cached) yes
  316. checking sys/time.h usability... yes
  317. checking sys/time.h presence... yes
  318. checking for sys/time.h... yes
  319. checking sys/timerfd.h usability... yes
  320. checking sys/timerfd.h presence... yes
  321. checking for sys/timerfd.h... yes
  322. checking sys/uio.h usability... yes
  323. checking sys/uio.h presence... yes
  324. checking for sys/uio.h... yes
  325. checking sys/wait.h usability... yes
  326. checking sys/wait.h presence... yes
  327. checking for sys/wait.h... yes
  328. checking errno.h usability... yes
  329. checking errno.h presence... yes
  330. checking for errno.h... yes
  331. checking for sys/sysctl.h... yes
  332. checking for TAILQ_FOREACH in sys/queue.h... yes
  333. checking for timeradd in sys/time.h... yes
  334. checking for timercmp in sys/time.h... yes
  335. checking for timerclear in sys/time.h... yes
  336. checking for timerisset in sys/time.h... yes
  337. checking whether CTL_KERN is declared... yes
  338. checking whether KERN_RANDOM is declared... yes
  339. checking whether RANDOM_UUID is declared... yes
  340. checking whether KERN_ARND is declared... no
  341. checking for an ANSI C-conforming const... yes
  342. checking for inline... inline
  343. checking whether time.h and sys/time.h may both be included... yes
  344. checking for accept4... yes
  345. checking for arc4random... no
  346. checking for arc4random_buf... no
  347. checking for eventfd... yes
  348. checking for epoll_create1... yes
  349. checking for fcntl... yes
  350. checking for getegid... yes
  351. checking for geteuid... yes
  352. checking for getifaddrs... yes
  353. checking for getnameinfo... yes
  354. checking for getprotobynumber... yes
  355. checking for gettimeofday... yes
  356. checking for inet_ntop... yes
  357. checking for inet_pton... yes
  358. checking for issetugid... no
  359. checking for mach_absolute_time... no
  360. checking for mmap... yes
  361. checking for nanosleep... yes
  362. checking for pipe... yes
  363. checking for pipe2... yes
  364. checking for putenv... yes
  365. checking for sendfile... yes
  366. checking for setenv... yes
  367. checking for setrlimit... yes
  368. checking for sigaction... yes
  369. checking for signal... yes
  370. checking for splice... yes
  371. checking for strlcpy... no
  372. checking for strsep... yes
  373. checking for strtok_r... yes
  374. checking for strtoll... yes
  375. checking for sysctl... yes
  376. checking for timerfd_create... yes
  377. checking for umask... yes
  378. checking for unsetenv... yes
  379. checking for usleep... yes
  380. checking for vasprintf... yes
  381. checking for getservbyname... yes
  382. checking for getaddrinfo... yes
  383. checking for F_SETFD in fcntl.h... yes
  384. checking for select... yes
  385. checking for poll... yes
  386. checking for epoll_ctl... yes
  387. checking waitpid support WNOWAIT... no
  388. checking for port_create... no
  389. checking for pid_t... yes
  390. checking for size_t... yes
  391. checking for ssize_t... yes
  392. checking for uint64_t... yes
  393. checking for uint32_t... yes
  394. checking for uint16_t... yes
  395. checking for uint8_t... yes
  396. checking for uintptr_t... yes
  397. checking for fd_mask... yes
  398. checking size of long long...
  399. checking size of long...
  400. checking size of int...
  401. checking size of short...
  402. checking size of size_t...
  403. checking size of void *...
  404. checking size of off_t...
  405. checking for struct in6_addr... yes
  406. checking for struct sockaddr_in6... yes
  407. checking for sa_family_t... yes
  408. checking for struct addrinfo... yes
  409. checking for struct sockaddr_storage... yes
  410. checking for struct in6_addr.s6_addr32... yes
  411. checking for struct in6_addr.s6_addr16... yes
  412. checking for struct sockaddr_in.sin_len... no
  413. checking for struct sockaddr_in6.sin6_len... no
  414. checking for struct sockaddr_storage.ss_family... yes
  415. checking for struct sockaddr_storage.__ss_family... no
  416. checking for struct so_linger... no
  417. checking for socklen_t... yes
  418. checking whether our compiler supports __func__... yes
  419. checking for the pthreads library -lpthreads... no
  420. checking whether pthreads work without any flags... yes
  421. checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
  422. checking if more special flags are required for pthreads... no
  423. checking size of pthread_t...
  424. checking for library containing ERR_remove_thread_state... -lcrypto
  425. checking that generated files are newer than configure... done
  426. configure: creating ./config.status
  427. config.status: creating libevent.pc
  428. config.status: creating libevent_openssl.pc
  429. config.status: creating libevent_pthreads.pc
  430. config.status: creating libevent_core.pc
  431. config.status: creating libevent_extra.pc
  432. config.status: creating Makefile
  433. config.status: creating config.h
  434. config.status: creating evconfig-private.h
  435. config.status: evconfig-private.h is unchanged
  436. config.status: executing depfiles commands
  437. config.status: executing libtool commands
  438. GEN test/rpcgen-attempted
  439. GEN include/event2/event-config.h
  440. make all-am
  441. make[]: Entering directory `/tmp/libevent-2.1.-stable'
  442. CC buffer.lo
  443. CC bufferevent.lo
  444. CC bufferevent_filter.lo
  445. CC bufferevent_pair.lo
  446. CC bufferevent_ratelim.lo
  447. CC bufferevent_sock.lo
  448. CC event.lo
  449. CC evmap.lo
  450. CC evthread.lo
  451. CC evutil.lo
  452. CC evutil_rand.lo
  453. CC evutil_time.lo
  454. CC listener.lo
  455. CC log.lo
  456. CC strlcpy.lo
  457. CC select.lo
  458. CC poll.lo
  459. CC epoll.lo
  460. CC signal.lo
  461. CC evdns.lo
  462. CC event_tagging.lo
  463. CC evrpc.lo
  464. CC http.lo
  465. CCLD libevent.la
  466. CCLD libevent_core.la
  467. CCLD libevent_extra.la
  468. CC evthread_pthread.lo
  469. CCLD libevent_pthreads.la
  470. CC libevent_openssl_la-bufferevent_openssl.lo
  471. CCLD libevent_openssl.la
  472. CC sample/dns-example.o
  473. CCLD sample/dns-example
  474. CC sample/event-read-fifo.o
  475. CCLD sample/event-read-fifo
  476. CC sample/hello-world.o
  477. CCLD sample/hello-world
  478. CC sample/http-server.o
  479. CCLD sample/http-server
  480. CC sample/http-connect.o
  481. CCLD sample/http-connect
  482. CC sample/signal-test.o
  483. CCLD sample/signal-test
  484. CC sample/time-test.o
  485. CCLD sample/time-test
  486. CC sample/le-proxy.o
  487. CCLD sample/le-proxy
  488. CC sample/https-client.o
  489. CC sample/hostcheck.o
  490. CC sample/openssl_hostname_validation.o
  491. CCLD sample/https-client
  492. CC test/bench.o
  493. CCLD test/bench
  494. CC test/bench_cascade.o
  495. CCLD test/bench_cascade
  496. CC test/bench_http.o
  497. CCLD test/bench_http
  498. CC test/bench_httpclient.o
  499. CCLD test/bench_httpclient
  500. CC test/test-changelist.o
  501. CCLD test/test-changelist
  502. CC test/test-dumpevents.o
  503. CCLD test/test-dumpevents
  504. CC test/test-eof.o
  505. CCLD test/test-eof
  506. CC test/test-closed.o
  507. CCLD test/test-closed
  508. CC test/test-fdleak.o
  509. CCLD test/test-fdleak
  510. CC test/test-init.o
  511. CCLD test/test-init
  512. CC test/test-ratelim.o
  513. CCLD test/test-ratelim
  514. CC test/test-time.o
  515. CCLD test/test-time
  516. CC test/test-weof.o
  517. CCLD test/test-weof
  518. CC test/test_regress-regress.o
  519. CC test/test_regress-regress.gen.o
  520. CC test/test_regress-regress_buffer.o
  521. CC test/test_regress-regress_bufferevent.o
  522. CC test/test_regress-regress_dns.o
  523. CC test/test_regress-regress_et.o
  524. CC test/test_regress-regress_finalize.o
  525. CC test/test_regress-regress_http.o
  526. CC test/test_regress-regress_listener.o
  527. CC test/test_regress-regress_main.o
  528. CC test/test_regress-regress_minheap.o
  529. CC test/test_regress-regress_rpc.o
  530. CC test/test_regress-regress_testutils.o
  531. CC test/test_regress-regress_util.o
  532. CC test/test_regress-tinytest.o
  533. CC test/test_regress-regress_thread.o
  534. CC test/test_regress-regress_zlib.o
  535. CC test/test_regress-regress_ssl.o
  536. CCLD test/regress
  537. make[]: Leaving directory `/tmp/libevent-2.1.-stable'
  538. make install-am
  539. make[]: Entering directory `/tmp/libevent-2.1.-stable'
  540. make[]: Entering directory `/tmp/libevent-2.1.-stable'
  541. /bin/mkdir -p '/export/servers/libevent-2.1.8/bin'
  542. /usr/bin/install -c event_rpcgen.py '/export/servers/libevent-2.1.8/bin'
  543. /bin/mkdir -p '/export/servers/libevent-2.1.8/lib'
  544. /bin/sh ./libtool --mode=install /usr/bin/install -c libevent.la libevent_core.la libevent_extra.la libevent_pthreads.la libevent_openssl.la '/export/servers/libevent-2.1.8/lib'
  545. libtool: install: /usr/bin/install -c .libs/libevent-2.1.so.6.0. /export/servers/libevent-2.1./lib/libevent-2.1.so.6.0.
  546. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent-2.1.so.6.0. libevent-2.1.so. || { rm -f libevent-2.1.so. && ln -s libevent-2.1.so.6.0. libevent-2.1.so.; }; })
  547. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent-2.1.so.6.0. libevent.so || { rm -f libevent.so && ln -s libevent-2.1.so.6.0. libevent.so; }; })
  548. libtool: install: /usr/bin/install -c .libs/libevent.lai /export/servers/libevent-2.1./lib/libevent.la
  549. libtool: install: /usr/bin/install -c .libs/libevent_core-2.1.so.6.0. /export/servers/libevent-2.1./lib/libevent_core-2.1.so.6.0.
  550. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_core-2.1.so.6.0. libevent_core-2.1.so. || { rm -f libevent_core-2.1.so. && ln -s libevent_core-2.1.so.6.0. libevent_core-2.1.so.; }; })
  551. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_core-2.1.so.6.0. libevent_core.so || { rm -f libevent_core.so && ln -s libevent_core-2.1.so.6.0. libevent_core.so; }; })
  552. libtool: install: /usr/bin/install -c .libs/libevent_core.lai /export/servers/libevent-2.1./lib/libevent_core.la
  553. libtool: install: /usr/bin/install -c .libs/libevent_extra-2.1.so.6.0. /export/servers/libevent-2.1./lib/libevent_extra-2.1.so.6.0.
  554. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_extra-2.1.so.6.0. libevent_extra-2.1.so. || { rm -f libevent_extra-2.1.so. && ln -s libevent_extra-2.1.so.6.0. libevent_extra-2.1.so.; }; })
  555. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_extra-2.1.so.6.0. libevent_extra.so || { rm -f libevent_extra.so && ln -s libevent_extra-2.1.so.6.0. libevent_extra.so; }; })
  556. libtool: install: /usr/bin/install -c .libs/libevent_extra.lai /export/servers/libevent-2.1./lib/libevent_extra.la
  557. libtool: install: /usr/bin/install -c .libs/libevent_pthreads-2.1.so.6.0. /export/servers/libevent-2.1./lib/libevent_pthreads-2.1.so.6.0.
  558. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_pthreads-2.1.so.6.0. libevent_pthreads-2.1.so. || { rm -f libevent_pthreads-2.1.so. && ln -s libevent_pthreads-2.1.so.6.0. libevent_pthreads-2.1.so.; }; })
  559. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_pthreads-2.1.so.6.0. libevent_pthreads.so || { rm -f libevent_pthreads.so && ln -s libevent_pthreads-2.1.so.6.0. libevent_pthreads.so; }; })
  560. libtool: install: /usr/bin/install -c .libs/libevent_pthreads.lai /export/servers/libevent-2.1./lib/libevent_pthreads.la
  561. libtool: install: /usr/bin/install -c .libs/libevent_openssl-2.1.so.6.0. /export/servers/libevent-2.1./lib/libevent_openssl-2.1.so.6.0.
  562. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_openssl-2.1.so.6.0. libevent_openssl-2.1.so. || { rm -f libevent_openssl-2.1.so. && ln -s libevent_openssl-2.1.so.6.0. libevent_openssl-2.1.so.; }; })
  563. libtool: install: (cd /export/servers/libevent-2.1./lib && { ln -s -f libevent_openssl-2.1.so.6.0. libevent_openssl.so || { rm -f libevent_openssl.so && ln -s libevent_openssl-2.1.so.6.0. libevent_openssl.so; }; })
  564. libtool: install: /usr/bin/install -c .libs/libevent_openssl.lai /export/servers/libevent-2.1./lib/libevent_openssl.la
  565. libtool: install: /usr/bin/install -c .libs/libevent.a /export/servers/libevent-2.1./lib/libevent.a
  566. libtool: install: chmod /export/servers/libevent-2.1./lib/libevent.a
  567. libtool: install: ranlib /export/servers/libevent-2.1./lib/libevent.a
  568. libtool: install: /usr/bin/install -c .libs/libevent_core.a /export/servers/libevent-2.1./lib/libevent_core.a
  569. libtool: install: chmod /export/servers/libevent-2.1./lib/libevent_core.a
  570. libtool: install: ranlib /export/servers/libevent-2.1./lib/libevent_core.a
  571. libtool: install: /usr/bin/install -c .libs/libevent_extra.a /export/servers/libevent-2.1./lib/libevent_extra.a
  572. libtool: install: chmod /export/servers/libevent-2.1./lib/libevent_extra.a
  573. libtool: install: ranlib /export/servers/libevent-2.1./lib/libevent_extra.a
  574. libtool: install: /usr/bin/install -c .libs/libevent_pthreads.a /export/servers/libevent-2.1./lib/libevent_pthreads.a
  575. libtool: install: chmod /export/servers/libevent-2.1./lib/libevent_pthreads.a
  576. libtool: install: ranlib /export/servers/libevent-2.1./lib/libevent_pthreads.a
  577. libtool: install: /usr/bin/install -c .libs/libevent_openssl.a /export/servers/libevent-2.1./lib/libevent_openssl.a
  578. libtool: install: chmod /export/servers/libevent-2.1./lib/libevent_openssl.a
  579. libtool: install: ranlib /export/servers/libevent-2.1./lib/libevent_openssl.a
  580. libtool: finish: PATH="/export/servers/jdk1.8.0_20/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /export/servers/libevent-2.1./lib
  581. ----------------------------------------------------------------------
  582. Libraries have been installed in:
  583. /export/servers/libevent-2.1./lib
  584.  
  585. If you ever happen to want to link against installed libraries
  586. in a given directory, LIBDIR, you must either use libtool, and
  587. specify the full pathname of the library, or use the '-LLIBDIR'
  588. flag during linking and do at least one of the following:
  589. - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
  590. during execution
  591. - add LIBDIR to the 'LD_RUN_PATH' environment variable
  592. during linking
  593. - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
  594. - have your system administrator add LIBDIR to '/etc/ld.so.conf'
  595.  
  596. See any operating system documentation about shared libraries for
  597. more information, such as the ld() and ld.so() manual pages.
  598. ----------------------------------------------------------------------
  599. /bin/mkdir -p '/export/servers/libevent-2.1.8/include'
  600. /usr/bin/install -c -m include/evdns.h include/event.h include/evhttp.h include/evrpc.h include/evutil.h '/export/servers/libevent-2.1.8/include'
  601. /bin/mkdir -p '/export/servers/libevent-2.1.8/include/event2'
  602. /usr/bin/install -c -m include/event2/buffer.h include/event2/buffer_compat.h include/event2/bufferevent.h include/event2/bufferevent_compat.h include/event2/bufferevent_ssl.h include/event2/bufferevent_struct.h include/event2/dns.h include/event2/dns_compat.h include/event2/dns_struct.h include/event2/event.h include/event2/event_compat.h include/event2/event_struct.h include/event2/http.h include/event2/http_compat.h include/event2/http_struct.h include/event2/keyvalq_struct.h include/event2/listener.h include/event2/rpc.h include/event2/rpc_compat.h include/event2/rpc_struct.h include/event2/tag.h include/event2/tag_compat.h include/event2/thread.h include/event2/util.h include/event2/visibility.h '/export/servers/libevent-2.1.8/include/event2'
  603. /bin/mkdir -p '/export/servers/libevent-2.1.8/include/event2'
  604. /usr/bin/install -c -m include/event2/event-config.h '/export/servers/libevent-2.1.8/include/event2'
  605. /bin/mkdir -p '/export/servers/libevent-2.1.8/lib/pkgconfig'
  606. /usr/bin/install -c -m libevent.pc libevent_core.pc libevent_extra.pc libevent_pthreads.pc libevent_openssl.pc '/export/servers/libevent-2.1.8/lib/pkgconfig'
  607. make[]: Leaving directory `/tmp/libevent-2.1.-stable'
  608. make[]: Leaving directory `/tmp/libevent-2.1.-stable'
  609. ----------
  610. ID: /export/servers/libevent-2.1.
  611. Function: file.directory
  612. Result: True
  613. Comment: The directory /export/servers/libevent-2.1. is in the correct state
  614. Started: ::11.693267
  615. Duration: 1.892 ms
  616. Changes:
  617.  
  618. Summary for 10.182.76.78
  619. -------------
  620. Succeeded: (changed=)
  621. Failed:
  622. -------------
  623. Total states run:
  624. Total run time: 59.920 s

Memcached配置

《SaltStack技术入门与实践》—— 实践案例 <中小型Web架构>3 Memcached配置管理的更多相关文章

  1. 《SaltStack技术入门与实践》—— Grains

    Grains 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 前几章我们已经了解SaltStack各个组件以及通过一个案例去熟悉它的各种应用,从这章开 ...

  2. 《SaltStack技术入门与实践》—— Peer

    Peer 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 Peer组件是SaltStack中Minion向Master发布任务的一个组件,使用Peer ...

  3. 《SaltStack技术入门与实践》—— Mine

    Mine 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 Mine是SaltStack收集Minion数据存储到Master的一个组件,它的功能与Gr ...

  4. 《SaltStack技术入门与实践》—— Renderer组件

    Renderer组件 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 前面我们已经提过使用Python语言编写state.sls文件.在SaltSta ...

  5. 《SaltStack技术入门与实践》—— Event和Reactor系统

    Event和Reactor系统 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 Event是SaltStack里面的对每个事件的一个记录,它相比job ...

  6. 《SaltStack技术入门与实践》—— Job管理

    Job管理 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 在SaltStack里面执行任何一个操作都会在Master上产生一个jid号.Minion ...

  7. 《SaltStack技术入门与实践》——执行结果处理

    执行结果处理 本章节参考<SaltStack技术入门与实践>,感谢该书作者: 刘继伟.沈灿.赵舜东 Return组件可以理解为SaltStack系统对执行Minion返回后的数据进行存储或 ...

  8. saltstack技术入门与实践

    基本原理 SaltStack 采用`C/S`模式,server端就是salt的master,client端就是minion,minion与master之间通过`ZeroMQ`消息队列通信. minio ...

  9. 读《淘宝技术这十年》 总结下web架构的发展

    关键词就两 分布式 缓存 分布式 数据库,应用服务器等的多节点部署,数据库的读写分离,剥离文件系统 缓存 数据缓存 静态页面缓存 php时代 最初LAMP起步 并将数据库做读写分离,拆分为主库+从库 ...

随机推荐

  1. NFA转换为等价的DFA

    在编译系统中,词法分析阶段是整个编译系统的基础.对于单词的识别,有限自动机FA是一种十分有效的工具.有限自动机由其映射f是否为单值而分为确定的有限自动机DFA和非确定的有限自动机NFA.在非确定的有限 ...

  2. 在Linux命令行模式安装VMware Tools

    在Linux命令行模式安装VMware Tools 方法/步骤1: 首先启动CentOS 7,在VMware中点击上方“VM”,点击“Install VMware Tools...”(如已安装则显示“ ...

  3. Pytorch笔记 (1) 初始神经网络

    一.人工神经元 上方人工神经元中: 输入 * 权重 ——>  相当于 人神经元中  树突的功能 各输入 相加 ,再做非线性变化f ——>  相当于胞体的功能 将非线性变化的结果输出 ——& ...

  4. 【BW系列】SAP 讲讲BW/4 HANA和BW on HANA的区别

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[BW系列]SAP 讲讲BW/4 HANA和BW ...

  5. LeetCode.1018-可被5整除的二进制数(Binary Prefix Divisible By 5)

    这是小川的第379次更新,第407篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第241题(顺位题号是1018).给定0和1的数组A,考虑N_i:从A[0]到A[i]的第 ...

  6. Akka系列(九):Akka分布式之Akka Remote

    前言.... Akka作为一个天生用于构建分布式应用的工具,当然提供了用于分布式组件即Akka Remote,那么我们就来看看如何用Akka Remote以及Akka Serialization来构建 ...

  7. 使用graphics.h来绘制图形

    |   版权声明:本文为博主原创文章,未经博主允许不得转载. graphics.h是TC里面的图形库,如果要用的话应该用TC来编译.分为:像素函数.直线和线型函数.多边形函数.填充函数等.然而在我们使 ...

  8. Spring MVC 中使用AOP 进行统一日志管理--XML配置实现

    1.介绍 上一篇博客写了使用AOP进行统一日志管理的注解版实现,今天写一下使用XML配置实现版本,与上篇不同的是上次我们记录的Controller层日志,这次我们记录的是Service层的日志.使用的 ...

  9. 28、周末看电影(每周五自动从top250中随机选取三部电影,并将下载链接发到邮箱里)

      练习介绍   在第3关的一个课后练习里,我们爬取了指定电影的下载链接:在第6关的一个课后练习里,我们存储了豆瓣TOP250的榜单信息.   现在,我们完善这个程序,每周五在存储的榜单中,随机抽三部 ...

  10. c# 模拟post登录

    使用模拟登录大致可以分为两步 一.post登录获取cookis public CookieContainer GetCookie(string url,string account,string pa ...