metabase tutorial

to build

install docker

The recommended version is 20 (stepping on the pit)
and the tutorial can be viewed directly: https://blog.csdn.net/shenyunsese/article/details/125596369
Uninstall and reinstall to see this: https://blog.csdn.net/m0_59196543/article /details/124749175

enable docker

Use of Docker

  1. Start docker by command
sudo systemctl start docker  
  1. stop docker service
systemctl stop docker  
  1. Restart the docker service
sudo systemctl restart docker  
  1. Enter the command to view the docker version
    to judge docker
docker -v

install database

Link

The notes are organized as follows:

  1. Switch to the /usr/local directory under the linux system to create the mysql folder
#切换目录
cd /usr/local

#创建文件夹
mkdir mysql
  1. Switch to the directory you just created, and use wget to download the mysql compressed package
cd mysql

wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz

① When executing the download command, the
error -bash: ?wget: command not found may be reported, because the system has not installed the wget software package, you only need to execute the
above download command again after executing yum -y install wget successfully, and the file will be Download to the current directory (mysql). (Slower)
② Of course, you can also download directly from the official website or visit https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz to download Go to the local and then upload to the server. How to upload can be done by Baidu.

  1. Unzip the file and modify the file name.
    Unzip the file command:
tar xvJf mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz

Modify the file name command:

mv mysql-8.0.20-linux-glibc2.12-x86_64 mysql-8.0.20
  1. Switch to the mysql-8.0.20 folder and create a folder for storing mysql data
#切换文件夹
cd mysql-8.0.20

#创建文件夹
mkdir data
  1. Create user groups and users
groupadd mysql

useradd -g mysql mysql
  1. authorized user
chown -R mysql.mysql /usr/local/mysql/mysql-8.0.20

7. Switch to the bin directory and initialize the basic information

cd bin

./mysqld --user=mysql --basedir=/usr/local/mysql/mysql-8.0.20 --datadir=/usr/local/mysql/mysql-8.0.20/data/ --initialize

insert image description here

Obtain a temporary password, please copy it and record it (you will need to modify it later).

  1. Edit the my.cnf file
#使用vim编辑器,编辑配置文件
vim /etc/my.cnf

Add content as follows

#添加修改的内容:
[mysqld]
basedir=/usr/local/mysql/mysql-8.0.20/
datadir=/usr/local/mysql/mysql-8.0.20/data/
socket=/tmp/mysql.sock
character-set-server=UTF8MB4
symbolic-links=0

insert image description here
The following three lines should be commented out

Tips: ①basedir and datadir need to modify the path according to the mysql installation location;
②vim editor: press i to enter the insert editing mode; press ctrl+c or esc and then type: wq to exit and save, just want to exit without saving and type: q;
③ [mysqld] cannot be missing and cannot be written as [mysql];

  1. Add the mysqld service to the system (note that it is executed under the mysql-8.0.20 file)
cd /usr/local/mysql/mysql-8.0.20
cp -a ./support-files/mysql.server /etc/init.d/mysql
  1. Authorize and add services
chmod +x /etc/init.d/mysql

chkconfig --add mysql
  1. Start mysql and check the running status of mysql
service mysql start

service mysql status

Effect:
insert image description here

  1. Add the mysql command to the service
ln -s /usr/local/mysql/mysql-8.0.20/bin/mysql /usr/bin
  1. log in to mysql
mysql -uroot -p

After withdrawal,
enter the following login command, and enter the initial password copied above, the entered password will not be displayed

  1. Modify the initial password of root, here I set it to 123456 (decided by myself)
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

15. Make the modified content take effect immediately

flush privileges;

Press ctrl+z to exit the mysql command page, and then log in with the new password to test whether the modification is successful

  1. Modify the remote connection to take effect

# After re-entering mysql, view all libraries

show databases;

#Select the mysql library

use mysql;

#Update the remote connection to take effect

update user set host='%' where user='root';

# Make the settings take effect immediately

flush privileges;

  1. Extension: Execute after exiting using Navicat remote connection
ip addr
#查看ip地址

Enter the connection name (name it yourself)
and enter the host (the IP of linux, if you don’t know it, you can execute ip addr in linux to view it) The
default mysql port is 3306 ,
the user name is root,
the password is the new password after reset, and finally click connect
insert image description here

install metabase

tutorial link

  1. Reference document
    https://zhuanlan.zhihu.com/p/52085283

  2. Installation
    (1). The jar package is installed directly

wget http://downloads.metabase.com/v0.30.0/metabase.jar
java -jar metabase.jar

(2) Install using docker (recommended)

#拉去镜像
docker pull metabase/metabase:latest  
#或者
docker pull metabase/metabase:v0.30.0

运行镜像
docker run -d -p 3000:3000 --name metabase metabase/metabase

docker run -d -p 3000:3000 -v /mnt/docker_data/metabase:/tmp -e "MB_DB_FILE=/tmp/metabase.db" --name metabase metabase/metabase


  1. Port 3000 is opened by default
http://47.105.197.196:3000
  1. If there is an error, check to see if it is a port problem
netstat -tuln 
  1. delete container
docker stop metabase
docker start metabase
docker rm metabase
docker ps -a
docker ps

docker run -d -p 3000:3000 --name metabase metabase/metabase
  1. Will involve the firewall to open
    the link

About Intranet Penetration

https://natapp.cn/article/natapp_newbie
This link can be used

Guess you like

Origin blog.csdn.net/weixin_41867184/article/details/128886632