linuxサーバcentosインストールredisおよび関連環境構成javaプロジェクトのメンテナンス

4629 ワード

リモート接続サーバssh接続ツールSecureCRTダウンロード:SecureCRTダウンロードリンク
 
1.centosサーバの下にjdkリンクをインストール
2.centosサーバの下にtomcatリンクをインストールする
3.centosサーバの下にredisリンクをインストールする
 
 
linuxのcentosサーバでredisをインストールするには、次の手順に従います.
1.依存関係のインストール
#   gcc  
yum -y install gcc

# tcl  
cd /usr/local/services/tcl

#  tcl   
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz

#  tcl   
tar -zvxf tcl8.6.1-src.tar.gz

#  tcl
cd  /usr/local/services/tcl/tcl8.6.1/unix/
./configure
make
make install

2.redisのインストールとコンパイル
#  redis   
cd /usr/local/services/redis
wget http://download.redis.io/releases/redis-4.0.8.tar.gz

#  redis   
tar -zxvf redis-4.0.8.tar.gz

#  redis
make
#        /usr/local/redis/redis-4.0.8/bin/    
make PREFIX=/usr/local/redis/redis-4.0.8/ install
#          /usr/local/dev/redis-4.0.8/bin/    
cp /usr/local/redis/redis-4.0.8/redis.conf /usr/local/redis/redis-4.0.8/bin/

3.redis構成
#             
cd /usr/local/redis/redis-4.0.8/bin/
vim redis.conf

#    ,     ip  
bind 127.0.0.1

#    protected-mode no
protected-mode yes

#   daemonize yes ,      
daemonize no

4.redis起動自起動設定
vim /etc/rc.d/rc.local

#        
source /etc/profile
# Redis   
/usr/local/redis/redis-4.0.8/bin/redis-server /usr/local/redis/redis-4.0.8/bin/redis.conf

#       
chmod 755 /etc/rc.d/rc.local

5.redisサーバおよびクライアントの起動
#  redis    
cd /usr/local/services/redis/redis-4.0.8/bin
./redis-server

#        ,  redis        

25081:C 10 Mar 22:11:48.981 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25081:C 10 Mar 22:11:48.981 # Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=25081, just started
25081:C 10 Mar 22:11:48.981 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
25081:M 10 Mar 22:11:48.982 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 25081
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

25081:M 10 Mar 22:11:48.983 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
25081:M 10 Mar 22:11:48.983 # Server initialized
25081:M 10 Mar 22:11:48.983 # 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.
25081:M 10 Mar 22:11:48.983 # 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.
25081:M 10 Mar 22:11:48.983 * Ready to accept connections

6.初期化スクリプトの実行
#  redis   
cd /usr/local/services/redis/redis-4.0.8/bin
#         
./redis-cli

#            ,  rddis   
set finance_product_open open
set pay_flag true
set order_flag true
set user_regist_flag true
set addmoney_flag true
set finance_conf_min_order_price 20
set finance_product_cal_flag true