일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 노트북 모니터 끄기
- ubuntu-server
- Docker
- 갤럭시북 사운드카드 설치
- 내장모니터끄기
- 광고없이 보기
- 유투브 광고 우회
- tomcat
- 코로나
- 마스크
- IOS
- 미국은 또 시궁창
- 앞으로 가기
- ㅂㅅ 같은 삼성 노트북
- 크롬
- aws
- lb
- 포켓몬고
- 클러스터링
- OSX
- 공기청정기
- 포켓몬 고
- 로드밸런싱
- Linux
- PM 2.5
- 사운드 설치
- java
- 미세먼지
- 포켓몬고 플러스
- 초미세먼지
- Today
- Total
살며사랑하며
centos tomcat redis3 clustering connect 본문
tomcat - redis culster - session - replication
1. redis cluster
install centos 7
yum update -y
sudo systemctl set-default multi-user.target
#selinux off
sudo vi /etc/sysconfig/selinux
#SELINUX=enforcing 을 SELINUX=disabled 로 변경후 저장한다.
SELINUX=disabled
sudo yum install -y gcc epel-release java-1.8.0-openjdk lrzsz telnet htop wget automake cronie network-tools ruby g++ make automake autoconf curl-devel openssl-devel zlib-devel
sudo yum install -y ruby-rdoc ruby-devel rubygems tcl
gem install redis
sudo firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="10.0.0.0/24" accept"
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
sudo hostnamectl set-hostname drawhanredis1
hostname
sudo vi /etc/hosts
10.0.0.151 drawhanredis1
10.0.0.152 drawhanredis2
10.0.0.153 drawhanredis3
10.0.0.161 drawhanweb1
10.0.0.162 drawhanweb2
10.0.0.163 drawhanwas1
10.0.0.164 drawhanwas2
10.0.0.165 drawhanmobile1
10.0.0.166 drawhanmobile2
10.0.0.167 drawhanmobile3
10.0.0.168 drawhanwcms1
10.0.0.169 drawhanwcms2
mkdir ~/src ; cd ~/src; wget hdrawhan://download.redis.io/releases/redis-3.2.1.tar.gz ; tar xvzf redis-3.2.1.tar.gz
make test; make ; make install;
~/src/redis-3.2.1/utils/install_server.sh
src/redis-trib.rb create --replicas 1 172.16.0.151:7000 172.16.0.152:7001 172.16.0.153:7000 172.16.0.151:7001 172.16.0.152:7000 172.16.0.153:7001
2. apache 설치
install centos 7
yum update -y
sudo yum install -y gcc epel-release java-1.8.0-openjdk lrzsz telnet htop wget automake cronie network-tools g++ make automake autoconf curl-devel openssl-devel zlib-devel
sudo systemctl set-default multi-user.target
#selinux off
sudo vi /etc/sysconfig/selinux
#SELINUX=enforcing 을 SELINUX=disabled 로 변경후 저장한다.
SELINUX=disabled
sudo yum install -y hdrawhand hdrawhand-devel
#mod_ajp_proxy balancer configure
sudo vi /etc/hdrawhand/conf.d/virtual.conf
nameVirtualHost *:80
<Proxy balancer://drawhanCluster>
Order deny,allow
Allow from all
BalancerMember ajp://drawhanwas1:9002
BalancerMember ajp://drawhanwas2:9002
ProxySet lbmethod=bytraffic
</Proxy>
<VirtualHost *:80>
ServerName drawhanwas1
#ProxyPreserveHost On
ProxyPass / balancer://drawhanCluster/
ProxyPassReverse / balancer://drawhanCluster/
#ProxyPass / ajp://drawhanwas1:9002/
#ProxyPassReverse / ajp://drawhanwas1:9002/
</VirtualHost>
3.tomcat 설치
install centos 7
yum update -y
sudo yum install -y gcc epel-release java-1.8.0-openjdk lrzsz telnet htop wget automake cronie network-tools g++ make automake autoconf curl-devel openssl-devel zlib-devel
sudo systemctl set-default multi-user.target
#selinux off
sudo vi /etc/sysconfig/selinux
#SELINUX=enforcing 을 SELINUX=disabled 로 변경후 저장한다.
SELINUX=disabled
#tomcat download
wget hdrawhan://apache.tt.co.kr/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.zip
unzip apache-tomcat-8.0.36.zip
mv apache-tomcat-8.0.36 tomcat8
sudo mv tomcat8 /usr/share
sudo chown -R drawhan.drawhan /usr/share/tomcat8
vi /usr/share/tomcat8/conf/context.xml
<!-- 주석처리 -->
<!-- <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> -->
<!-- 추가 -->
<Valve className="com.r.tomcat.session.management.RequestSessionHandlerValve" />
<Manager className="com.r.tomcat.session.management.RequestSessionManager" />
#redis config 추가
vi /usr/share/tomcat8/conf/RedisDataCache.properties
# redis hosts ex: 127.0.0.1:6379, 127.0.0.2:6379, 127.0.0.2:6380, ....
redis.hosts=drawhanredis1:7000, drawhanredis2:7001, drawhanredis3:7000
# Redis Password
redis.password=
# set true to enable redis cluster mode
redis.cluster.enabled=true
#lib 추가 ( hdrawhans://github.com/ran-jit/TomcatClusterRedisSessionManager )
cp TomcatClusterEnabledRedisSessionManager-1.0.jar /usr/share/tomcat8/lib