1、检验部署
(venv) [root@slave1 tair_bin]# ./sbin/tairclient -c 192.168.60.101:5198 -g group_test
TAIR> put name foo
put: success
TAIR> get name
KEY: name, LEN: 3
raw data: fo, \66\6F\6F
TAIR>
2、使用 Python 和 Tair SDK 连接 Tair
```>>> from tair import Tair
host = "192.168.60.101"
port = 5198
password = None
client = Tair(host=host, port=port, password=password)
client.set("name", "Tair Example")
Traceback (most recent call last):
File "", line 1, in
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/commands/core.py", line 2302, in set
return self.execute_command("SET", pieces, *options)
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/client.py", line 1258, in execute_command
return conn.retry.call_with_retry(
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/retry.py", line 49, in call_with_retry
fail(error)
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/client.py", line 1262, in
lambda error: self._disconnect_raise(conn, error),
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/client.py", line 1248, in _disconnect_raise
raise error
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/retry.py", line 46, in call_with_retry
return do()
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/client.py", line 1259, in
lambda: self._send_command_parse_response(
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/client.py", line 1235, in _send_command_parse_response
return self.parse_response(conn, command_name, options)
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/client.py", line 1275, in parse_response
response = connection.read_response()
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/connection.py", line 848, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/connection.py", line 482, in read_response
self.read_from_socket()
File "/opt/cyber/securityrange/venv/lib/python3.9/site-packages/redis/connection.py", line 444, in read_from_socket
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
redis.exceptions.ConnectionError: Connection closed by server.
3、日志记录
[root@slave1 ~]# tail -f /root/tair_bin/logs/config.log
[2024-11-21 09:45:44.679037] ERROR decode_cb (packet_factory.cpp:90) [139698103080704] decoding failed: flag=707988746, len=170144781, m->status=0, pcode=1397052429
[2024-11-21 09:45:44.678] easy_connection.c:952(tid:7f0dffcf5700) decode error, [::ffff:192.168.60.101]:55366_30_0x7f0df00013b0 m=0x7f0df00030b0, cnt=0
[2024-11-21 09:49:00.399246] ERROR decode_cb (packet_factory.cpp:90) [139698103080704] decoding failed: flag=707988746, len=170144781, m->status=0, pcode=1397052429
[2024-11-21 09:49:00.399] easy_connection.c:952(tid:7f0dffcf5700) decode error, [::ffff:192.168.60.101]:55398_30_0x7f0df00013b0 m=0x7f0df00030b0, cnt=0
```
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。