Linux下开启redis

bash-4.2# cd ..
bash-4.2# ls
bin   dev  home  lib64	mnt	opt   root  sbin  sys	 tmp  var
boot  etc  lib	 media	mydata	proc  run   srv   tiger  usr
bash-4.2# cd usr
bash-4.2# ls
bin  etc  games  include  lib  lib64  libexec  local  sbin  share  src	tmp
bash-4.2# ls lib
alsa	    games	java-1.8.0   kernel	     rpm
binfmt.d    gcc		java-ext     locale	     sse2
cpp	    gems	jvm	     modprobe.d      sysctl.d
crda	    grub	jvm-commmon  modules	     systemd
cups	    hsqldb	jvm-exports  modules-load.d  tmpfiles.d
debug	    inkscape	jvm-private  mozilla	     tuned
dracut	    java	kbd	     NetworkManager  udev
firewalld   java-1.5.0	kde3	     os-release      x86_64-redhat-linux6E
firmware    java-1.6.0	kde4	     polkit-1	     yum-plugins
fontconfig  java-1.7.0	kdump	     python2.7
bash-4.2# cd local/
bash-4.2# ls
bin  etc  games  include  lib  lib64  libexec  redis  sbin  share  src
bash-4.2# cd redis
bash-4.2# ls
dump.rdb  redis-cli  redis.conf  redis-server
bash-4.2# ./redis-server 
5686:C 08 Oct 2021 10:35:04.777 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5686:C 08 Oct 2021 10:35:04.777 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=5686, just started
5686:C 08 Oct 2021 10:35:04.777 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
5686:M 08 Oct 2021 10:35:04.778 * Increased maximum number of open files to 10032 (it was originally set to 1024).
5686:M 08 Oct 2021 10:35:04.778 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.5 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 5686
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

5686:M 08 Oct 2021 10:35:04.779 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
5686:M 08 Oct 2021 10:35:04.779 # Server initialized
5686:M 08 Oct 2021 10:35:04.779 # 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.
5686:M 08 Oct 2021 10:35:04.780 * Loading RDB produced by version 6.2.5
5686:M 08 Oct 2021 10:35:04.780 * RDB age 1903491 seconds
5686:M 08 Oct 2021 10:35:04.780 * RDB memory usage when created 0.78 Mb
5686:M 08 Oct 2021 10:35:04.781 * DB loaded from disk: 0.001 seconds
5686:M 08 Oct 2021 10:35:04.781 * Ready to accept connections

如果报错: Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
则:

bash-4.2# ./redis-server 
15160:C 08 Oct 2021 20:53:42.496 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
15160:C 08 Oct 2021 20:53:42.496 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=15160, just started
15160:C 08 Oct 2021 20:53:42.496 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
15160:M 08 Oct 2021 20:53:42.497 * Increased maximum number of open files to 10032 (it was originally set to 1024).
15160:M 08 Oct 2021 20:53:42.497 * monotonic clock: POSIX clock_gettime
15160:M 08 Oct 2021 20:53:42.497 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
15160:M 08 Oct 2021 20:53:42.497 # Failed listening on port 6379 (TCP), aborting.
bash-4.2# ps -ef | grep redis
root       5686      1  0 10:45 ?        00:01:00 ./redis-server *:6379
root      15183  15110  0 20:54 pts/1    00:00:00 grep redis
bash-4.2# kill -5686 3086 
bash: kill: 5686: 无效的信号声明
bash-4.2# kill -9 5086 
bash: kill: (5086) - 没有那个进程
bash-4.2# kill -9 5686 
bash-4.2# ./redis-server
15202:C 08 Oct 2021 20:55:56.647 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
15202:C 08 Oct 2021 20:55:56.647 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=15202, just started
15202:C 08 Oct 2021 20:55:56.647 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
15202:M 08 Oct 2021 20:55:56.648 * Increased maximum number of open files to 10032 (it was originally set to 1024).
15202:M 08 Oct 2021 20:55:56.648 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.5 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 15202
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

15202:M 08 Oct 2021 20:55:56.649 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
15202:M 08 Oct 2021 20:55:56.649 # Server initialized
15202:M 08 Oct 2021 20:55:56.649 # 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.
15202:M 08 Oct 2021 20:55:56.651 * Loading RDB produced by version 6.2.5
15202:M 08 Oct 2021 20:55:56.652 * RDB age 33651 seconds
15202:M 08 Oct 2021 20:55:56.652 * RDB memory usage when created 1.45 Mb
15202:M 08 Oct 2021 20:55:56.653 * DB loaded from disk: 0.002 seconds
15202:M 08 Oct 2021 20:55:56.653 * Ready to accept connections


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值