You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zh...@apache.org on 2020/05/08 12:34:20 UTC

[pulsar] 34/38: Fixed dashboard start failed (#6857)

This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 2aaf4d269c64c17c4dcd884cd7d5bc4d762d7a1a
Author: guangning <gu...@apache.org>
AuthorDate: Thu May 7 14:00:53 2020 +0800

    Fixed dashboard start failed (#6857)
    
    Master Issue: https://github.com/apache/pulsar/issues/5847
    
    ### Motivation
    
    Installation error of dashboard database postgres 11 resulted in startup failure.
    
    ### Modifications
    
    * Update apachepulsar/pulsar-dashboard:2.5.1 image https://hub.docker.com/layers/apachepulsar/pulsar-dashboard/2.5.1/images/sha256-61b47a7302639aba1357d09ca69a842c4a67bff38b230753d6bd638df0461c6b?context=explore
    * Update Docker file for fix postgresql version 11.
    
    ### Verifying this change
    
    Local test pass
    (cherry picked from commit c621d99b430ef6ddd379eb588eb5ed7ee4e85124)
---
 dashboard/Dockerfile       | 5 ++++-
 dashboard/init-postgres.sh | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dashboard/Dockerfile b/dashboard/Dockerfile
index 7388481..605e8ba 100644
--- a/dashboard/Dockerfile
+++ b/dashboard/Dockerfile
@@ -21,8 +21,11 @@ FROM python:3.7-stretch
 
 MAINTAINER Pulsar
 
+RUN bash -c "echo deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main >> /etc/apt/sources.list.d/pgdg.list"
+RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
+
 RUN apt-get update
-RUN apt-get -y install postgresql python sudo nginx supervisor
+RUN apt-get -y install postgresql-11 postgresql-contrib libpq-dev python sudo nginx supervisor
 
 # Postgres configuration
 COPY conf/postgresql.conf /etc/postgresql/11/main/
diff --git a/dashboard/init-postgres.sh b/dashboard/init-postgres.sh
index 5f4c627..fbb8ddb 100755
--- a/dashboard/init-postgres.sh
+++ b/dashboard/init-postgres.sh
@@ -24,7 +24,7 @@ rm -rf /data/*
 chown -R postgres: /data
 chmod 700 /data
 sudo -u postgres /usr/lib/postgresql/11/bin/initdb /data/
-sudo -u postgres /etc/init.d/postgresql start
+sudo -u postgres /usr/lib/postgresql/11/bin/pg_ctl -D /data/ start
 sudo -u postgres psql --command "CREATE USER docker WITH PASSWORD 'docker';"
 sudo -u postgres createdb -O docker pulsar_dashboard