5 linux下查看memcache是否正常

来源:互联网 发布:会计网络在线课程 编辑:程序博客网 时间:2024/05/29 13:50


 

1   查看memcache启动

1.1      在xshell中查看memcache是否启动

在xshell中输入ps -ef | grep mem,显示结果如下,说明memcache已经启动。

[root@localhostinstallation_locateserver]# ps -ef | grep mem

 

1.2      在浏览中查看memcache是否安装成功

(1).  查看Apache是否安装成功

在浏览器中输入服务器的ip地址http://192.168.2.47/,如出现如图的所示的界面说明Apache安装成功。


(2).  查看memcache是否运行正常

在浏览器的输入地址http://192.168.2.47/phpinfo.php,并查找memcache是否存在,并且显示正常。如下图所示。


2    访问memcache获得位置信息

2.1      通过telnet访问memcache

在定位系统正常运行后首先在本机查看位置信息,主要通过telnet来查看。

(1).    安装Telnet。

[root@localhost /]# yum install telnet

(2).  安装完成后输入telnet 127.0.0.1 11211连接到memcached服务器

[root@localhost /]# telnet 127.0.0.1 11211

(3).    访问位置结果

通过get命令获得key对应的值:

get 00258D00003A // 该值为对应的用户id

出现如图所示的结果,说明访问成功,定位结果存放到memcache正常,输入quit命令退出。


2.2      通过浏览器访问memcache

通过firefox浏览器访问memcache,需要安装插件poster。

安装poster

(1).    搜索poster插件,然后安装即可


(2).    启动poster工具


(3).    打开后如下图


说明:

1 定位系统所在服务器的url: http://192.168.2.55/locate.php

2 访问命令{"msg_type":"06","mac":"18002D2FAD1D","timestamp_c":"1394547912"}

3 发送post请求

(4).    返回结果


2.3      SELinux配置

SELinux 2.6版本的 Linux 内核中提供的强制访问控制(MAC)系统。

1.      查看SELinux

[root@localhost real_time_system]# sestatus 0


2.      临时关闭SELinux(不用重启机器):

设置SELinux成为permissive模式

[root@localhost real_time_system]# setenforce 0

3.        修改配置文件需要重启机器:

修改/etc/selinux/config文件

SELINUX=enforcing改为SELINUX=permissive


2.4        apachehttpd服务启动

当一切配置正常,通过telnet能够获得位置信息,但用外网访问的定位结果时获取失败,应该是http服务没有启动,需要配置http服务自启动。

[root@localhost \]# chkconfig httpd on

[root@localhost \]# chkconfig --list|grep http

httpd            0:off 1:off 2:on  3:on  4:on  5:on  6:off

0 0