Skip to content

python客户端pipeline问题 #184

Closed
@Kegann

Description

问题描述:
使用python客户端pipeline入库时报错,但数据却入进去了.

python程序:
import redis
r=redis.StrictRedis(host='10.40.0.70',port='9221')
pr=redis.pipeline()
pr.set('t1',1)
pr.set('t2',2)
pr.execute()

Traceback (most recent call last):
File "q5.py", line 7, in
pr.execute()
File "/usr/lib/python2.7/site-packages/redis/client.py", line 2879, in execute
return execute(conn, stack, raise_on_error)
File "/usr/lib/python2.7/site-packages/redis/client.py", line 2772, in execute_transaction
response = self.parse_response(connection, '
')
File "/usr/lib/python2.7/site-packages/redis/client.py", line 2838, in parse_response
self, connection, command_name, **options)
File "/usr/lib/python2.7/site-packages/redis/client.py", line 680, in parse_response
response = connection.read_response()
File "/usr/lib/python2.7/site-packages/redis/connection.py", line 629, in read_response
raise response
redis.exceptions.ResponseError: Err unknown or unsupported command 'exec'

查看数据库,数据却入进去了.
10.40.0.70:9221> keys *

  1. "t1"
  2. "t2"

补充说明:
redis-py版本:2.10.5
测试了将
r=redis.StrictRedis(host='10.40.0.70',port='9221') 的ip 端口改成本地redis的ip 端口就不会报错,因此推断客户端没有问题,想请问是不是pika不支持python客户端的批量?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions