Redis3.2安裝並通過Python連線
下載安裝包並解壓
wget -q http://124.202.164.16/files/2125000009862F7A/download.redis.io/releases/redis-3.2.6.tar.gz
tar -xzf redis-3.2.6.tar.gz
編譯
cd redis-3.2.6
make
..
geo.c: In function ‘membersOfAllNeighbors’:
geo.c:355: warning: missing initializer
geo.c:355: warning: (near initialization for ‘myarea.hash.step’)
geo.c:355: warning: missing initializer
geo.c:355: warning: (near initialization for ‘myarea.longitude’)
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
INSTALL redis-check-rdb
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/script/redis-3.2.6/src'
安裝
make install
cd src && make install
make[1]: Entering directory `/script/redis-3.2.6/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/script/redis-3.2.6/src'
啟動Redis伺服器
[root@localhost redis-3.2.6]# redis-server redis.conf &
[1] 11954
[root@localhost redis-3.2.6]# 11954:M 06 Dec 07:32:37.376 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 11954
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
11954:M 06 Dec 07:32:37.379 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
11954:M 06 Dec 07:32:37.380 # Server started, Redis version 3.2.6
11954:M 06 Dec 07:32:37.380 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
11954:M 06 Dec 07:32:37.387 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
11954:M 06 Dec 07:32:37.387 * DB loaded from disk: 0.000 seconds
11954:M 06 Dec 07:32:37.387 * The server is now ready to accept connections on port 6379
為Python語言安裝Redis客戶端庫
[root@localhost script]# pip install redis hiredis
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting redis
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading redis-2.10.5-py2.py3-none-any.whl (60kB)
100% |████████████████████████████████| 61kB 48kB/s
Collecting hiredis
Downloading hiredis-0.2.0.tar.gz (46kB)
100% |████████████████████████████████| 51kB 42kB/s
Installing collected packages: redis, hiredis
Running setup.py install for hiredis ... done
Successfully installed hiredis-0.2.0 redis-2.10.5
登入Redis
[root@localhost script]# python
Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> conn = redis.Redis()
>>> conn.set('hello', 'world')
True
>>> conn.get('hello')
'world'
wget -q http://124.202.164.16/files/2125000009862F7A/download.redis.io/releases/redis-3.2.6.tar.gz
tar -xzf redis-3.2.6.tar.gz
編譯
cd redis-3.2.6
make
..
geo.c: In function ‘membersOfAllNeighbors’:
geo.c:355: warning: missing initializer
geo.c:355: warning: (near initialization for ‘myarea.hash.step’)
geo.c:355: warning: missing initializer
geo.c:355: warning: (near initialization for ‘myarea.longitude’)
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
INSTALL redis-check-rdb
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/script/redis-3.2.6/src'
安裝
make install
cd src && make install
make[1]: Entering directory `/script/redis-3.2.6/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/script/redis-3.2.6/src'
啟動Redis伺服器
[root@localhost redis-3.2.6]# redis-server redis.conf &
[1] 11954
[root@localhost redis-3.2.6]# 11954:M 06 Dec 07:32:37.376 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 11954
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
11954:M 06 Dec 07:32:37.379 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
11954:M 06 Dec 07:32:37.380 # Server started, Redis version 3.2.6
11954:M 06 Dec 07:32:37.380 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
11954:M 06 Dec 07:32:37.387 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
11954:M 06 Dec 07:32:37.387 * DB loaded from disk: 0.000 seconds
11954:M 06 Dec 07:32:37.387 * The server is now ready to accept connections on port 6379
[root@localhost script]# pip install redis hiredis
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting redis
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading redis-2.10.5-py2.py3-none-any.whl (60kB)
100% |████████████████████████████████| 61kB 48kB/s
Collecting hiredis
Downloading hiredis-0.2.0.tar.gz (46kB)
100% |████████████████████████████████| 51kB 42kB/s
Installing collected packages: redis, hiredis
Running setup.py install for hiredis ... done
Successfully installed hiredis-0.2.0 redis-2.10.5
[root@localhost script]# python
Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> conn = redis.Redis()
>>> conn.set('hello', 'world')
True
>>> conn.get('hello')
'world'
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2129927/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Ubuntu Server安裝介面並VNC連線UbuntuServerVNC
- java通過kerberos認證連線hdfs並寫數JavaROS
- mysql--通過cmd連線mysql,並建立資料庫MySql資料庫
- ubuntu系統安裝mysql並支援遠端連線的詳細過程UbuntuMySql
- mysql 通過IP連線MySql
- VMware安裝映象Centos7,並連線XshellCentOS
- docker安裝mysql8.0.20並遠端連線DockerMySql
- Laravel 通過 ODBC 連線 VerticaLaravel
- 通過跳板機連線MySQLMySql
- centos7安裝單機環境redis3.2CentOSRedisS3
- 安裝python並使用Python
- centos7安裝圖形化介面並使用Windows遠端連線,安裝xrdpCentOSWindows
- oracle連線SQLserver--通過ODBCOracleSQLServer
- Vm安裝虛擬機器並使用net模式連線外網虛擬機模式
- IDEA安裝外掛【Database navigation】並連線資料庫IdeaDatabaseNavigation資料庫
- python連線Oracle的外掛cx_Oracle安裝PythonOracle
- vnc遠端安裝,10個步驟在Linux中遠端安裝VNC並連線VNCLinux
- 通過cman連線報ora-12564拒絕連線
- python連線mysql並插入資料(自用)PythonMySql
- rhel9.2離線下載安裝包,並安裝
- 在centos7中安裝redis,並通過node.js操作redisCentOSRedisNode.js
- Linux下如何通過命令連線wifiLinuxWiFi
- 通過外來鍵連線多個表
- 通過驅動建立與MySQL的連線MySql
- 通過因特網連線Beaglebone Black
- 通過單例模式模擬RAC連線單例模式
- 通過vnc連線linux伺服器VNCLinux伺服器
- python中的pip的安裝以及通過pip命令對selenium進行解除安裝和安裝Python
- docker 安裝redis 以及配置連線DockerRedis
- 安裝配置PGBouncer連線池
- Mac下通過Homebrew安裝MySQLMacMySql
- 通過git安裝npm私有模組GitNPM
- zt:通過vnc 安裝linuxVNCLinux
- Centos7下安裝Sql*Plus並連線遠端Oralce伺服器CentOSSQL伺服器
- Windows Homestead 離線安裝,帶盒子連線Windows
- 不安裝oracle client客戶端通過plsql developer連線oracle10.2.0.4Oracleclient客戶端SQLDeveloper
- 通過virtualenv安裝指定版本的python的虛擬環境Python
- 1.3.3. 通過SQL*Plus 連線資料庫SQL資料庫