Self hosted redash 5.2 from source | centos 7


#1

System environment [ platform : CENTOS 7.0 | python : 2.7 ]

chown -r redash:redash /opt
redash location : /opt/redash

yum upgrade
sudo yum install epel-release
sudo yum install python-pip
sudo yum groupinstall ‘development tools’
sudo yum install gcc python-pip.noarch python-devel
sudo yum -y install python-setuptools python-pip

sudo yum install redis
sudo systemctl start redis
sudo systemctl enable redis

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install nodejs
sudo yum install gcc-c++ make

rpm -Uvh https://yum.postgresql.org/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
yum install postgresql10-server postgresql10
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl start postgresql-10.service
systemctl enable postgresql-10.service

su — postgres
psql
create user redash;
dont set the password for it neither you need to set any database or permission for it

easy_install supervisor
echo_supervisord_conf > /etc/supervisord.conf
vim /usr/lib/systemd/system/supervisord.service

[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
User=user1
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable supervisord
systemctl start supervisord.service

you will be needed oracle clinet software ,version 11.2 works for sure and you will need the basic,devel and sqlplus rpms for redash, so go ahead and download from oracle .simply a google search will lead you there and make sure to download the x64 edition .

yum install libaio
rpm -Uvh oracle-instantclient11.2-basic.x86_64.rpm
rpm -Uvh oracle-instantclient11.2-devel.x86_64.rpm
rpm -Uvh oracle-instantclient11.2-sqlplus.x86_64.rpm
echo “/usr/lib/oracle/11.2/client64/lib” >/etc/ld.so.conf.d/oracle.conf
ldconfig
su — redash
cd /home/redash
vim .bashrc
enter the follwing entry
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin
export REDASH_ADDITIONAL_QUERY_RUNNERS=redash.query_runner.oracle
source .bashrc
pip install cx_Oracle===5.2.1

sudo yum install git-core
sudo pip install -r requirements.txt -r requirements_dev.txt
npm install
npm run build

bin/run ./manage.py check_settings
bin/run ./manage.py database create_tables

bin/run ./manage.py runserver --debugger --reload --host=0.0.0.0
./bin/run celery worker --app=redash.worker --beat -Qscheduled_queries,queries,celery -c2
npm run start

you can run redash by executing the following script .
vim /opt/redash/nohup_redash.sh
chmod +x nohup_redash.sh
./opt/redash/nohup_redash.sh

> nohup bin/run ./manage.py runserver --debugger --reload --host=0.0.0.0 > redash-output.log 2>&1 &
> 
> nohup ./bin/run celery worker --app=redash.worker --beat -Qscheduled_queries,queries,celery -c2 > redash-output_celery.log 2>&1 &
> 
> nohup npm run start redash-output_npm.log 2>&1 &

:grinning: