linux redis操作メモ
15166 ワード
[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でないのは容易で、直接第2文を実行します
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
pm 2 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
定義時Noメッセージの暗号化 <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>
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は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
定義時Noメッセージの暗号化
<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>