memcached 安装使用

使用redhat6.0系统在线安装时提示ThissystemisnotregisteredwithRHN.如下:

[root@localhost~]#yuminstallgcc

Loadedplugins:rhnplugin,security

ThissystemisnotregisteredwithRHN.

RHNsupportwillbedisabled.

SettingupInstallProcess

Nopackagehttpdavailable.

Nothingtodo

解决方案:

检查是否安装yum

预备:rpm-qa|grepyum

1.卸载redhat自带的yum组件

[root@localhost~]#rpm-qa|grepyum|xargsrpm-e--nodeps

2.安装centos的yum包(要求python是2.6以上版本)

#wgethttp://mirror.centos.org/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

#wgethttp://mirror.centos.org/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm

#wgethttp://mirror.centos.org/centos/6/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm

#wgethttp://mirror.centos.org/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

#rpm-ivhpython-iniparse-0.3.1-2.1.el6.noarch.rpm

#rpm-ivhyum-metadata-parser-1.1.2-16.el6.i686.rpm

#rpm-ivhyum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

注意最后两个包必需同时安装,否则会相互依赖

3.下载更新源,并存放在系统目录中

[root@localhost~]#wgethttp://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

[root@localhost~]#mvCentOS_Base.repo/etc/yum.repos.d/CentOS-Base.repo

4.生成缓存并进行安装

[root@localhost~]#yummakecache

至此可以使用yum了。

补充更改yum源方法:

#我们使用网易的CentOS镜像源

#cd/etc/yum.repos.d/

#wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo

#viCentOS6-Base-163.repo

编辑文件,把文件里面的$releasever全部替换为版本号,即6最后保存!或者直接把下面的内存拷贝到CentOS6-Base-163.repo文件中即可(已经修改好)

#########################################################################

#CentOS-Base.repo

#

#ThemirrorsystemusestheconnectingIPaddressoftheclientandthe

#updatestatusofeachmirrortopickmirrorsthatareupdatedtoand

#geographicallyclosetotheclient.YoushouldusethisforCentOSupdates

#unlessyouaremanuallypickingothermirrors.

#

#Ifthemirrorlist=doesnotworkforyou,asafallbackyoucantrythe

#remarkedoutbaseurl=lineinstead.

#

#

[base]

name=CentOS-6-Base-163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#releasedupdates

[updates]

name=CentOS-6-Updates-163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additionalpackagesthatmaybeuseful

[extras]

name=CentOS-6-Extras-163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additionalpackagesthatextendfunctionalityofexistingpackages

[centosplus]

name=CentOS-6-Plus-163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib-packagesbyCentosUsers

[contrib]

name=CentOS-6-Contrib-163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#########################################################################

清理yum缓存

#yumcleanall

#yummakecache#将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度

#yuminstallvim*#测试域名是否可用

5.安装telnet

安装telenet方法

5-1、yuminstalltelnet-server服务端

5-2、yuminstalltelnet客户端

5-3、vi/etc/xinetd.d/telnet

servicetelnet

{

flags=REUSE

socket_type=stream

wait=no

user=root

server=/usr/sbin/in.telnetd

log_on_failure+=USERID

disable=yes

}

将disable项由yes改成no。

5-4、/etc/init.d/xinetdrestart

命令:

启动:/usr/bin/memcached-d-m3000-uroot-p11211-c256-P/var/run/memcached1.pid

关闭:kill`cat/var/run/memcached1.pid`

默认情况下memcached安装到/usr/bin下。

进入安装目录,启动memcached:/usr/memcached/bin/memcached-d-c10240-m1024-uroot

获取运行状态:echostats|nclocalhost11211(可以查看出pid)或使用ps-ef|grepmemcached

停止memcached:kill-9pid(-9表示强制杀死,pid为进程的进程标识符)

相关推荐