linux redis操作小记

        [root@pc ~] ps -ef | grep redis
        [root@pc ~] ll /etc/redis
        [root@pc ~] ll/etc/redis.conf
        [root@pc ~] service stop redis
        [root@pc ~] ps -ef | grep redis
        [root@pc ~] ps -ef|grep 12319
        [root@pc ~]# cd /usr/local/
        [root@pc local]# ll
        [root@pc local]# ll /opt/
        [root@pc local]# ll /opt/wdlt/
        [root@pc local]# cd /opt/
        [root@pc opt]# ll
        [root@pc opt]# cd redis-3.2.8/src/
        [root@pc src]# ll
        [root@pc src]# cd ../
        [root@pc redis-3.2.8]# ll
        [root@pc redis-3.2.8]# locate redis.conf
        locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
        [root@pc redis-3.2.8]# service redis start
        Redirecting to /bin/systemctl start  redis.service
        [root@pc redis-3.2.8]# ps -ef|grep redis
        [root@pc redis-3.2.8]# setenforce 0
        [root@pc redis-3.2.8]# service iptables stop
        Redirecting to /bin/systemctl stop  iptables.service
        Failed to stop iptables.service: Unit iptables.service not loaded.
        [root@pc redis-3.2.8]# service firewall stop
        Redirecting to /bin/systemctl stop  firewall.service
        Failed to stop firewall.service: Unit firewall.service not loaded.
        [root@pc redis-3.2.8]# service firewalld stop
        Redirecting to /bin/systemctl stop  firewalld.service
        [root@pc redis-3.2.8]# telnet 192.168.1.200 6379
        -bash: telnet: command not found
        [root@pc redis-3.2.8]# yum install telnet
        [root@pc redis-3.2.8]# telnet 192.168.1.200 6379
        [root@pc redis-3.2.8]# netstat -ant
        [root@pc redis-3.2.8]# telnet 192.168.1.200 6379
        Trying 192.168.1.200...
        telnet: connect to address 192.168.1.200: Connection refused
        [root@pc redis-3.2.8]# telnet 127.0.0.1 6379
        Trying 127.0.0.1...
        Connected to 127.0.0.1.
        [root@pc redis-3.2.8]# vim /opt/redis-3.2.8/redis.conf
        [root@pc redis-3.2.8]# vim /etc/redis.conf
        [root@pc redis-3.2.8]# service redis stop
        Redirecting to /bin/systemctl stop  redis.service
        [root@pc redis-3.2.8]# service redis start
        Redirecting to /bin/systemctl start  redis.service
        [root@pc redis-3.2.8]# telnet 192.168.1.200 6379
        Trying 192.168.1.200...
        Connected to 192.168.1.200.
        Escape character is '^]'.
        quit
        +OK




        [root@pc redis-3.2.8]# vim /etc/redis.conf
        #bind 127.0.0.1
        bind 192.168.1.200

Redis在docker容器中,非docker容易,直接执行第二句

docker exec -it redis-sn /bin/bash
 
进docker 后 redis-cli


keys * 查询redis中所有key

Redis若干命令

增删改查:



keys *
取出当前匹配的所有key

> exists larry
(integer) 0

当前的key是否存在

del lv
删除当前key

expire
设置过期时间

> expire larry 10
(integer) 1

> move larry ad4
(integer) 1

移动larry键值对到ad4数据库

> persist lv
(integer) 1
移除当前key的过期时间

randomkey

随机返回一个key

rename
重命名key

type
返回值的数据类型

 type testlist
list


> ping
PONG

测试连接是否还在

>echo name

"larry"

打印

> select ad4databank
OK
数据库切换

> quit
退出连接

> dbsize
(integer) 12

当前数据库中key的数量

> info
服务器基本信息

monitor

实时转储收到的请求

config get
获取服务器的参数配置

flushdb
清空当前数据库

flushall
清除所有数据库

Redis服务开启

#加上`&`号使redis以后台程序方式运行
./redis-server &
[root@BLESSED-TEC-T redis-3.2.8]# redis-server ./redis.conf
[root@BLESSED-TEC-T redis-3.2.8]# redis-cli
127.0.0.1:6379> keys *




Linux命令,文件重命名,删除文件,解压文件

mv website website.bak
rm -f website
mv website201706221559.zip.bak website201706221559.zip
unzip website201706221559.zip

1.df -h
linux中df命令的功能是用来检查linux服务器的文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。
2.ps -ef | grep java
ps -ef查看所有进程  grep筛选出信息   pid为进程id

3.jmap -heap  [pid]
查看堆栈信息

top 查看进程 
free -m free是显示的当前内存的使用 -m用m字节显示


pm2 nodeJS命令

pm2 start server.js --name oms

pm2 list  
pm2 stop index
pm2 delete index 
pm2 start appname


ngrok代理开启命令

cd /opt/ngrok
./ngrok -config ngrok.cfg start http 

ngrok后台运行:

nohup /opt/ngrok/ngrok -config  /opt/ngrok/ngrok.cfg start http &

或

setsid  /opt/ngrok/ngrok -config  /opt/ngrok/ngrok.cfg start http

查看ngrok进程
ps -ef | grep ngrok

杀掉进程
kill -9 sid



基于wsimport生成代码的客户端

wsimport是jdk自带的命令,可以根据wsdl文档生成客户端中间代码,基于生成的代码编写客户端,可以省很多麻烦。

参考链接:https://www.cnblogs.com/ywjy/p/5196064.html


wsimport -keep -p com.wdletu.ticket.client -d H:\\ http://ws.51book.com:8000/ltips/services/getAvailableFlightWithPriceAndCommisionService1.0?wsdl

以下内容为转载部分, 文章链接: http://blog.csdn.net/u012881904/article/details/64440842

学会查看wsdl文档

wsdl:operation:相当于一个方法的名称

<wsdl:operation name="GetRecordGroupInfo">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">方法的作用</wsdl:documentation>
  <wsdl:input message="tns:GetRecordGroupInfoSoapIn" />
  <wsdl:output message="tns:GetRecordGroupInfoSoapOut" />
</wsdl:operation>
 
 
  • 1
  • 2
  • 3
  • 4
  • 5

wsdl:input message 相当于一个输入的参数 
wsdl:output message 相当于一个返回值 
wsdl:part 输入参数有几个部分,每个部分相当于一个类或者是一个基本的类型

<wsdl:message name="GetRecordGroupInfoSoapIn">
    <wsdl:part name="parameters" element="tns:GetRecordGroupInfo" />
</wsdl:message>
 
 
  • 1
  • 2
  • 3

s:element 代表表一个参数 
s:complexType 是一个复杂的类型,相当于类

<s:element name="GetRecordGroupInfo">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="address" type="s:string" />
        <s:element minOccurs="1" maxOccurs="1" name="port" type="s:int" />
        <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
        <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
        <s:element minOccurs="1" maxOccurs="1" name="iscvr" type="s:boolean" />
      </s:sequence>
    </s:complexType>
</s:element>
 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

定义时否对消息加密

 <wsdl:operation name="GetMultiRecordPlan">
      <soap:operation soapAction="http://storage.vrm.org/envr/GetMultiRecordPlan" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值