Mudanças entre as edições de "Metabase"
De MochilaWiki
Ir para navegaçãoIr para pesquisarLinha 42: | Linha 42: | ||
[Service] | [Service] | ||
+ | MB_PASSWORD_COMPLEXITY=strong | ||
+ | MB_PASSWORD_LENGTH=12 | ||
+ | MB_DB_TYPE=mysql | ||
+ | MB_DB_DBNAME=metabase | ||
+ | MB_DB_PORT=3306 | ||
+ | MB_DB_USER=metabase_user | ||
+ | MB_DB_PASS=Strong_Password | ||
+ | MB_DB_HOST=localhost | ||
+ | MB_EMOJI_IN_LOGS=true | ||
WorkingDirectory=/home/metabase/ | WorkingDirectory=/home/metabase/ | ||
ExecStart=/usr/bin/java -jar /home/metabase/metabase.jar | ExecStart=/usr/bin/java -jar /home/metabase/metabase.jar | ||
Linha 58: | Linha 67: | ||
em /etc/rsyslog.d/metabase.conf | em /etc/rsyslog.d/metabase.conf | ||
+ | if $programname == 'metabase' then /var/log/metabase.log | ||
+ | & stop | ||
+ | |||
+ | <source lang="bash"> | ||
+ | systemctl restart rsyslog.service | ||
+ | </source> | ||
+ | |||
+ | em /etc/default/metabase (alternativa, mas não funcionou no meu teste... deu certo inserindo no service) | ||
+ | MB_PASSWORD_COMPLEXITY=strong #weak|strong | ||
+ | MB_PASSWORD_LENGTH=10 | ||
+ | MB_DB_TYPE=mysql #postgres|mysql|h2 | ||
+ | MB_DB_DBNAME=metabase | ||
+ | MB_DB_PORT=3306 | ||
+ | MB_DB_USER=metabase_user | ||
+ | MB_DB_PASS=Strong_Password | ||
+ | MB_DB_HOST=localhost | ||
+ | MB_EMOJI_IN_LOGS=true #true|false | ||
+ | |||
+ | iniciando metabase e habilitando para iniciar no boot | ||
+ | <source lang="bash"> | ||
+ | systemctl daemon-reload | ||
+ | systemctl start metabase | ||
+ | systemctl enable metabase | ||
+ | </source> | ||
+ | |||
+ | === instalando e configurando o nginx === | ||
+ | <source lang="bash"> | ||
+ | apt install nginx | ||
+ | </source> | ||
+ | |||
+ | em /etc/nginx/sites-available/metabase | ||
+ | <source lang="nginx"> | ||
+ | server { | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | server_name example.com; | ||
+ | location / { | ||
+ | proxy_pass http://127.0.0.1:3000; | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | reiniciando nginx e habilitando para iniciar no boot | ||
+ | <source lang="bash"> | ||
+ | ln -s /etc/nginx/sites-available/metabase /etc/nginx/sites-enabled/metabase | ||
+ | systemctl daemon-reload | ||
+ | systemctl restart nginx | ||
+ | systemctl enable nginx | ||
+ | </source> |
Edição das 02h14min de 1 de junho de 2021
Instalando em Ubuntu 20.04
dependências
apt update
apt install openjdk-11-jdk openjdk-11-jre
apt install mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysql -u root -p
criando banco de dados
CREATE DATABASE metabase;
CREATE USER 'metabase_user'@'localhost' IDENTIFIED BY 'Strong_Password';
GRANT ALL ON metabase.* TO 'metabase_user'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
instalando
mkdir /home/metabase
cd /home/metabase
wget https://downloads.metabase.com/v0.39.3/metabase.jar
groupadd -r metabase
useradd -r -s /bin/false -g metabase metabase
chown -R metabase:metabase /home/metabase
touch /var/log/metabase.log
chown metabase:metabase /var/log/metabase.log
touch /etc/default/metabase
chmod 640 /etc/default/metabase
em /etc/systemd/system/metabase.service
[Unit] Description=Metabase server After=syslog.target After=network.target [Service] MB_PASSWORD_COMPLEXITY=strong MB_PASSWORD_LENGTH=12 MB_DB_TYPE=mysql MB_DB_DBNAME=metabase MB_DB_PORT=3306 MB_DB_USER=metabase_user MB_DB_PASS=Strong_Password MB_DB_HOST=localhost MB_EMOJI_IN_LOGS=true WorkingDirectory=/home/metabase/ ExecStart=/usr/bin/java -jar /home/metabase/metabase.jar EnvironmentFile=/etc/default/metabase User=metabase Type=simple StandardOutput=syslog StandardError=syslog SyslogIdentifier=metabase SuccessExitStatus=143 TimeoutStopSec=120 Restart=always [Install] WantedBy=multi-user.target
em /etc/rsyslog.d/metabase.conf
if $programname == 'metabase' then /var/log/metabase.log & stop
systemctl restart rsyslog.service
em /etc/default/metabase (alternativa, mas não funcionou no meu teste... deu certo inserindo no service)
MB_PASSWORD_COMPLEXITY=strong #weak|strong MB_PASSWORD_LENGTH=10 MB_DB_TYPE=mysql #postgres|mysql|h2 MB_DB_DBNAME=metabase MB_DB_PORT=3306 MB_DB_USER=metabase_user MB_DB_PASS=Strong_Password MB_DB_HOST=localhost MB_EMOJI_IN_LOGS=true #true|false
iniciando metabase e habilitando para iniciar no boot
systemctl daemon-reload
systemctl start metabase
systemctl enable metabase
instalando e configurando o nginx
apt install nginx
em /etc/nginx/sites-available/metabase
server {
listen 80;
listen [::]:80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
reiniciando nginx e habilitando para iniciar no boot
ln -s /etc/nginx/sites-available/metabase /etc/nginx/sites-enabled/metabase
systemctl daemon-reload
systemctl restart nginx
systemctl enable nginx