Ubuntu下安装Memcached
Memcached是免费、开源(BSD license授权)、高性能分布式的对象内存缓存系统,当初是Danga Interactive为了LiveJournal所发展的,但目前被许多软件(如MediaWiki)所使用。Memcached被广泛用于动态数据的缓存,可大大减低数据库负载与压力,提高数据库系统的性
Memcached是免费、开源(BSD license授权)、高性能分布式的对象内存缓存系统,当初是Danga Interactive为了LiveJournal所发展的,但目前被许多软件(如MediaWiki)所使用。Memcached被广泛用于动态数据的缓存,可大大减低数据库负载与压力,提高数据库系统的性能与容量,从而极大地增加动态网页的效率与网速。
Memcached缺乏认证以及安全管制,这代表应该将Memcached服务器放置在防火墙后。
Memcached具有多种语言的客户端开发包,包括:Perl/PHP/JAVA/C/Python/Ruby/C#/MySQL/
一、安装Memcached
A、通过源码编译安装
编译前,请先确认gcc、make、patch等编译工具是否已安装,并可正常使用。
安装Libevent
Libevent是一个异步事件处理软件函式库,以BSD许可证释出。Memcached依赖Libevent,因此必须先编译安装Libevent。
wget http://www.monkey.org/~provos/libevent-2.0.13-stable.tar.gz tar xzvf libevent-2.0.13-stable.tar.gz ./configure make make install
安装Memcached
wget http://memcached.googlecode.com/files/memcached-1.4.7.tar.gz tar xvzf memcached-1.4.7.tar.gz cd memcached-1.4.7 ./configure --prefix=/usr/local/memcached/ make make install
创建软链
ln -s /usr/local/lib/libevent-2.0.so.5 /lib/libevent-2.0.so.5
注:如果你不创建这个软链,启动memcached是可能会报./memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory这样的错误。这是因为memcached无法定位libevent库,libevent默认安装目录是/usr/local/lib/libevent-2.0.so.5,所以这里创建软链解决这个问题。
另:我在编译时用–with-libevent参数指定了libevent的位置,启动依然有这个问题。
启动memcache
./memcached -d -m 64 -p 11211 -l 127.0.0.1 -u nobody -c 1024
memcached常用启动参数描述:
-d:启动一个守护进程, -m:分配给Memcache使用的内存数量,单位是MB,默认是64MB, -u:运行Memcache的用户 -l:监听的服务器IP地址 -p:设置Memcache监听的端口,默认是11211注:-p(p为小写) -c:设置最大并发连接数,默认是1024 -P:设置保存Memcache的pid文件注:-P(P为大写) -h 显示帮助
B、通过APT包安装
apt-get install memcached
二、安装Memcache管理器
A、环境准备
安装Memcache客户端
方法一、通过APT安装
apt-get install php5-memcache
方法二、通过pecl安装
pecl install memcache
重启Apache
/etc/init.d/apache2 restart
B、安装MemAdmin
MemAdmin是一款可视化的Memcached管理与监控工具,使用PHP开发,体积小,操作简单。
主要功能:服务器参数监控:STATS、SETTINGS、ITEMS、SLABS、SIZES实时刷新。服务器性能监控:GET、DELETE、INCR、DECR、CAS等常用操作命中率实时监控。支持数据遍历,方便对存储内容进行监视。支持条件查询,筛选出满足条件的KEY或VALUE。数组、JSON等序列化字符反序列显示。 兼容memcache协议的其他服务,如Tokyo Tyrant (遍历功能除外)。支持服务器连接池,多服务器管理切换方便简洁。
安装
wget http://www.junopen.com/memadmin/memadmin-1.0.5.tar.gz tar xvzf memadmin-1.0.5.tar.gz cp -r memadmin /var/www/
配置访问用户
vi memadmin/config.php #根据自己情况修改用户名和密码 $config['user'] = "admin"; // your username $config['passwd'] = "admin"; // your password
访问https://域名(或IP)/memadmin/index.php,输入用户名/密码访问即可。
C、安装Memcachepphp
Memcachepphp也是一个WEB管理工具,这个程序只有一个文件,部署相当简单。Memcachepphp功能有:管理多个memcache服务器、实时查看各个服务器的内存使用状况、实时查看缓存命中情况、直接浏览缓存内容,删除指定缓存项等。
安装
wget http://livebookmark.net/memcachephp/memcachephp.zip unzip memcachephp.zip cp memcache.php /var/www/
配置Memcachepphp
根据自己的情况修改用户名密码和memcache服务器地址
vi memcache.php define(‘ADMIN_USERNAME’,'memcache’); // Admin Username define(‘ADMIN_PASSWORD’,'password’); // Admin Password define(‘DATE_FORMAT’,'Y/m/d H:i:s’); define(‘GRAPH_SIZE’,200); define(‘MAX_ITEM_DUMP’,50); $MEMCACHE_SERVERS[] = ‘localhost:11211′; // add more as an array //$MEMCACHE_SERVERS[] = ‘mymemcache-server2:11211′; // add more as an array
访问https://域名(或IP)/memadmin/index.php,输入用户名/密码访问即可。
原文地址:Ubuntu下安装Memcached, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution to the problem that Win11 system cannot install Chinese language pack With the launch of Windows 11 system, many users began to upgrade their operating system to experience new functions and interfaces. However, some users found that they were unable to install the Chinese language pack after upgrading, which troubled their experience. In this article, we will discuss the reasons why Win11 system cannot install the Chinese language pack and provide some solutions to help users solve this problem. Cause Analysis First, let us analyze the inability of Win11 system to

You may not be able to install guest additions to a virtual machine in OracleVirtualBox. When we click on Devices>InstallGuestAdditionsCDImage, it just throws an error as shown below: VirtualBox - Error: Unable to insert virtual disc C: Programming FilesOracleVirtualBoxVBoxGuestAdditions.iso into ubuntu machine In this post we will understand what happens when you What to do when you can't install guest additions in VirtualBox. Unable to install guest additions in VirtualBox If you can't install it in Virtua

In Ubuntu systems, the root user is usually disabled. To activate the root user, you can use the passwd command to set a password and then use the su- command to log in as root. The root user is a user with unrestricted system administrative rights. He has permissions to access and modify files, user management, software installation and removal, and system configuration changes. There are obvious differences between the root user and ordinary users. The root user has the highest authority and broader control rights in the system. The root user can execute important system commands and edit system files, which ordinary users cannot do. In this guide, I'll explore the Ubuntu root user, how to log in as root, and how it differs from a normal user. Notice

If you have successfully downloaded the installation file of Baidu Netdisk, but cannot install it normally, it may be that there is an error in the integrity of the software file or there is a problem with the residual files and registry entries. Let this site take care of it for users. Let’s introduce the analysis of the problem that Baidu Netdisk is successfully downloaded but cannot be installed. Analysis of the problem that Baidu Netdisk downloaded successfully but could not be installed 1. Check the integrity of the installation file: Make sure that the downloaded installation file is complete and not damaged. You can download it again, or try to download the installation file from another trusted source. 2. Turn off anti-virus software and firewall: Some anti-virus software or firewall programs may prevent the installation program from running properly. Try disabling or exiting the anti-virus software and firewall, then re-run the installation

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.

Angular.js is a freely accessible JavaScript platform for creating dynamic applications. It allows you to express various aspects of your application quickly and clearly by extending the syntax of HTML as a template language. Angular.js provides a range of tools to help you write, update and test your code. Additionally, it provides many features such as routing and form management. This guide will discuss how to install Angular on Ubuntu24. First, you need to install Node.js. Node.js is a JavaScript running environment based on the ChromeV8 engine that allows you to run JavaScript code on the server side. To be in Ub

For many users, hacking an Android TV box sounds daunting. However, developer Murray R. Van Luyn faced the challenge of looking for suitable alternatives to the Raspberry Pi during the Broadcom chip shortage. His collaborative efforts with the Armbia

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple
