Skip to content

Commit

Permalink
[ FAB-5254 ] Add logging for haproxy
Browse files Browse the repository at this point in the history
haproxyy logs are needed for debugging load test

Change-Id: I2f445f926663fb224da3d55c6e87c68a0ee657a2
Signed-off-by: rennman <[email protected]>
  • Loading branch information
rennman committed Jul 31, 2017
1 parent 77f573c commit 919d632
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
8 changes: 7 additions & 1 deletion images/fabric-ca-fvt/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ RUN dpkg-reconfigure locales && update-locale LANG=en_US.UTF-8
# Install more test depedencies
RUN echo "mysql-server mysql-server/root_password password mysql" | debconf-set-selections
RUN echo "mysql-server mysql-server/root_password_again password mysql" | debconf-set-selections
RUN apt-get -y install --no-install-recommends bc vim lsof sqlite3 haproxy postgresql-$PGVER \
RUN apt-get -y install --no-install-recommends rsyslog bc vim lsof sqlite3 haproxy postgresql-$PGVER \
postgresql-client-common postgresql-contrib-$PGVER isag jq git html2text \
debconf-utils zsh htop python2.7-minimal libpython2.7-stdlib \
mysql-client mysql-common mysql-server
RUN apt-get -y autoremove

# Configure rsyslog
# Include the imudp modules (syslog messages via UDP) by uncommenting
RUN sed -i 's/^[[:blank:]]*#\([[:blank:]]*.*imudp.*\)/\1/' /etc/rsyslog.conf
RUN rm /etc/rsyslog.d/*haproxy*conf
RUN printf "local2.* /var/log/haproxy.log\n& ~\n" > /etc/rsyslog.d/haproxy.conf

# Configure and start postgres
RUN echo $PGUSER:$PGUSER | chpasswd
RUN mkdir -p $PGDATA && chown postgres:postgres $PGDATA
Expand Down
1 change: 1 addition & 0 deletions images/fabric-ca-fvt/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LDAP_PORT=389
PORTS=($POSTGRES_PORT $MYSQL_PORT $LDAP_PORT)

timeout=12
service rsyslog start
su postgres -c 'postgres -D /usr/local/pgsql/data' &
chown -R mysql.mysql /var/lib/mysql
/usr/bin/mysqld_safe --sql-mode=STRICT_TRANS_TABLES &
Expand Down
16 changes: 9 additions & 7 deletions scripts/fvt/fabric-ca_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ function startHaproxy() {
case $TLS_ON in
"true")
haproxy -f <(echo "global
log /dev/log local0 debug
log /dev/log local1 debug
log 127.0.0.1 local2
daemon
defaults
log global
Expand All @@ -149,14 +148,17 @@ frontend haproxy
backend fabric-cas
mode tcp
balance roundrobin";
while test $((i++)) -lt $inst; do
echo " server server$i 127.0.0.$i:$server_port"
done)
# For each requested instance passed to startHaproxy
# (which is determined by the -n option passed to the
# main script) create a backend server in haproxy config
# Each server uses a separate loopback address.
while test $((i++)) -lt $inst; do
echo " server server$i 127.0.0.$i:$server_port"
done)
;;
*)
haproxy -f <(echo "global
log /dev/log local0 debug
log /dev/log local1 debug
log 127.0.0.1 local2
daemon
defaults
log global
Expand Down

0 comments on commit 919d632

Please sign in to comment.