這篇文章主要講解了“docker搭建redis集群的環(huán)境搭建”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“docker搭建redis集群的環(huán)境搭建”吧!
泰安ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!本文介紹了docker搭建redis集群的環(huán)境搭建,分享給大家,廢話不多說,具體如下:
下載鏡像
docker pull redis
準(zhǔn)備配置文件
mkdir /home/docker/redis/ wget https://raw.githubusercontent.com/antirez/redis/3.0/redis.conf -O /home/docker/redis/redis.conf cd /home/docker/redis/ sed -i 's/# slaveof <masterip> <masterport>/slaveof redis-master 6379/g' redis.conf
啟動redis容器
docker run --name redis-master -p 6379:6379 -d redis docker run --link redis-master:redis-master -v /home/docker/redis/redis.conf:/usr/local/etc/redis/redis.conf --name redis-slave1 -d redis redis-server /usr/local/etc/redis/redis.conf docker run --link redis-master:redis-master -v /home/docker/redis/redis.conf:/usr/local/etc/redis/redis.conf --name redis-slave2 -d redis redis-server /usr/local/etc/redis/redis.conf docker run --link redis-master:redis-master -v /home/docker/redis/redis.conf:/usr/local/etc/redis/redis.conf --name redis-slave3 -d redis redis-server /usr/local/etc/redis/redis.conf
查看redis集群
redis-cli 127.0.0.1:6379> info # Server redis_version:3.0.6 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:48bba53ba79f07ac redis_mode:standalone os:Linux 3.13.0-27-generic x86_64 arch_bits:64 multiplexing_api:epoll gcc_version:4.9.2 process_id:1 run_id:6d552d47e50137b6ee40697d7254891aa5dbdb68 tcp_port:6379 uptime_in_seconds:21554 uptime_in_days:0 hz:10 lru_clock:10637013 config_file: # Clients connected_clients:1 client_longest_output_list:0 client_biggest_input_buf:0 blocked_clients:0 # Memory used_memory:1926248 used_memory_human:1.84M used_memory_rss:4419584 used_memory_peak:1963096 used_memory_peak_human:1.87M used_memory_lua:36864 mem_fragmentation_ratio:2.29 mem_allocator:jemalloc-3.6.0 # Persistence loading:0 rdb_changes_since_last_save:0 rdb_bgsave_in_progress:0 rdb_last_save_time:1453456066 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:0 rdb_current_bgsave_time_sec:-1 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok aof_last_write_status:ok # Stats total_connections_received:5 total_commands_processed:64476 instantaneous_ops_per_sec:3 total_net_input_bytes:2426080 total_net_output_bytes:92455 instantaneous_input_kbps:0.14 instantaneous_output_kbps:0.02 rejected_connections:0 sync_full:3 sync_partial_ok:0 sync_partial_err:0 expired_keys:0 evicted_keys:0 keyspace_hits:0 keyspace_misses:0 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:222 migrate_cached_sockets:0 # Replication role:master connected_slaves:3 slave0:ip=172.17.0.2,port=6379,state=online,offset=30087,lag=1 slave1:ip=172.17.0.3,port=6379,state=online,offset=30101,lag=0 slave2:ip=172.17.0.4,port=6379,state=online,offset=30087,lag=1 master_repl_offset:30101 repl_backlog_active:1 repl_backlog_size:1048576 repl_backlog_first_byte_offset:2 repl_backlog_histlen:30100 # CPU used_cpu_sys:7.37 used_cpu_user:5.34 used_cpu_sys_children:0.00 used_cpu_user_children:0.00 # Cluster cluster_enabled:0 # Keyspace
感謝各位的閱讀,以上就是“docker搭建redis集群的環(huán)境搭建”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對docker搭建redis集群的環(huán)境搭建這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!
分享名稱:docker搭建redis集群的環(huán)境搭建-創(chuàng)新互聯(lián)
當(dāng)前地址:http://aaarwkj.com/article4/csosie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計、品牌網(wǎng)站設(shè)計、網(wǎng)站改版、Google、用戶體驗(yàn)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容