<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 第一種最簡啟動 啟動服務端 ~~~ redis-server //默認使用6379端口 ~~~ 打開另一個ssh終端,用客戶端進行連接 ~~~ redis-cli -h 127.0.0.1 -p 6379 ~~~ 連接成功 ~~~ [root@localhost ~]# redis-cli -h 127.0.0.1 -p 6379 127.0.0.1:6379> ~~~ ## 第二種(動態參數) 服務端使用6380端口 ~~~ redis-server --port 6380 //指定使用6380端口啟動redis ~~~ 客戶端 ~~~ redis-cli -p 6380 ~~~ ## 第三種使用配置文件的方式啟動(生產環境) 單機多實例配置文件可以用端口區分開. 進入Redis安裝目錄, 創建confing文件夾 . 拷貝redis.conf文件至config文件 . 因為Redis是單線程的,但是我們服務器基本都是多核的,所以我們經常在一臺服務器上部署很多的Redis . 這樣我們就需要配置很多的端口 . 這樣我們的配置文件就以端口來進行區分 . 比如將redis.conf文件名修改成redis-6381 . ~~~ cat redis-6381 | grep -v "#" |grep -v "^$" > redis-6382 //對原6381文件進行"#"注釋行進行過濾并重定向 為redis-6382 ~~~ 得到配置文件 ~~~ daemonize no pidfile /var/run/redis.pid //這里為進程存放的位置 port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 0 loglevel notice logfile "" databases 16 save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir ./ slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no slave-priority 100 appendonly no appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit slave 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 aof-rewrite-incremental-fsync yes ~~~ 修改為以下 ~~~ daemonize yes //修改為yes, 以守護進程的方式進行啟動 port 6382 //端口號修改為6382 dir "/opt/soft/redis/data" //工作目錄,就是我們的日志文件和持久化的文件存在哪個目錄 logfile "6382.log" //日志文件 logfile //redis系統日志,只是一個文件名 ~~~ 啟動 ~~~ redis-server config/redis-6382 ~~~ 查看進程是否存在 ~~~ ps -ef | grep 6382 ~~~ 結果,說明啟動成功 ~~~ root 18534 1 0 00:41 ? 00:00:00 redis-server *:6382 root 18538 18300 0 00:41 pts/0 00:00:00 grep --color=auto 6382 ~~~ 客戶端連接成功 ~~~ redis-cli -p 6382 127.0.0.1:6382> ~~~ 查看日志文件 ~~~ 18552:M 29 Mar 00:44:52.035 * Increased maximum number of open files to 10032 (it was originally set to 1024). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.0.7 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6382 | `-._ `._ / _.-' | PID: 18552 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' 18552:M 29 Mar 00:44:52.036 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 18552:M 29 Mar 00:44:52.036 # Server started, Redis version 3.0.7 18552:M 29 Mar 00:44:52.036 # 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. 18552:M 29 Mar 00:44:52.037 # 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. 18552:M 29 Mar 00:44:52.037 * The server is now ready to accept connections on port 6382 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看