Installing the Python Environment
mkdir /opt/soft
curl -O /miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
After Enter, keep pressing space and prompt Please answer 'yes' or 'no':' Enter yes.
Specify the installation path /opt/soft/conda, enter default
/opt/soft/conda
PREFIX=/opt/soft/conda
Initialize conda3 by typing yes
Do you wish the installer to initialize Miniconda3
[no] >>> yes
- Configuring System Environment Variables
vim /etc/profile
export CONDA_HOME=/opt/soft/conda
export PATH=$PATH:$CONDA_HOME/bin
source /etc/profile
source ~/.bashrc
You can see that there is an extra (base) in front of it, and the python version is 3.11.
Deactivate the base environment
conda config --set auto_activate_base false
bash
View conda version
Copy Success
conda --version
conda 24.3.0
Configuring conda domestic mirrors
Copy Success
conda config --add channels /anaconda/pkgs/free/
conda config --add channels /anaconda/pkgs/main/
conda config --add channels /anaconda/cloud/conda-forge/
conda config --add channels /anaconda/cloud/msys2/
conda config --set show_channel_urls yes
conda config --show channels
7) Create python 3.9 environment
conda create --name superset python=3.9
y
8) Activate the superset environment
conda activate superset
To exit the environment use the following command:
conda deactivate
mounting
1) Prepare dependencies for installation
Copy Success
sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel cyrus-sasl-devel openldap-devel
2) Install setuptools and pip
pip install --upgrade setuptools pip
3) Installation of supetest
pip install apache-superset --trusted-host -i /repository/pypi/simple
4) Initialize the database
superset db upgrade
Error with weak key security
pip show apache-superset
Go to the superset installation path
Generate paste_your_generated_secret_key_her
openssl rand -base64 42
vi superset_config.py
SECRET_KEY = 'paste_your_generated_secret_key_here'
SECRET_KEY = 'ocuiR5/s93tYYrIjuGhMFkWrM00tt7Kd3lt2tJ07rAnxgp+cg4jKFmHF'
vi /etc/profile
export SUPERSET_CONFIG_PATH=/opt/soft/conda/envs/superset/superset_config.py
source /etc/profile
5) Create an administrator user
export FLASK_APP=superset
superset fab create-admin
Username [admin]:
User first name [admin]:
User last name [user]:
Email [admin@]:
Password:
Repeat for confirmation:
Recognized Database Authentications.
root 12345678
6) Superset initialization
superset init
7) Install gunicorn
pip install gunicorn -i /simple/
8) Start superset
superset run -h linux122 -p 8080 --with-threads --reload --debugger
gunicorn --workers 5 --timeout 120 --bind [ip]:[port] ":create_app()" --daemon
To stop superset use the following command:
ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9
9) Login to Superset
linux122:8080
Username:root
Password:12345678
Access ip:[port] and log in with the administrator account created earlier.
Connect to the database:
Installation environment.
conda activate superset
yum install python-devel -y
pip install gevent
sudo yum install groupinstall 'development tools'
yum install mysql-devel -y
yum install gcc -y
pip install mysqlclient
report an error
writing top-level names to src/-info/top_level.txt
reading manifest file 'src/-info/'
reading manifest template ''
adding license file 'LICENSE'
writing manifest file 'src/-info/'
copying src/MySQLdb/_mysql.c -> build/-x86_64-cpython-39/MySQLdb
running build_ext
building 'MySQLdb._mysql' extension
creating build/-x86_64-cpython-39/src/MySQLdb
gcc -pthread -B /opt/soft/conda/envs/superset/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/soft/conda/envs/superset/include -fPIC -O2 -isystem /opt/soft/conda/envs/superset/include -fPIC "-Dversion_info=(2, 2, 4, 'final', 0)" -D__version__=2.2.4 -I/opt/soft/conda/envs/superset/include/python3.9 -c src/MySQLdb/_mysql.c -o build/-x86_64-cpython-39/src/MySQLdb/_mysql.o -I/usr/include/mysql -std=c99
src/MySQLdb/_mysql.c: in a function‘_mysql_ConnectionObject_Initialize’center:
src/MySQLdb/_mysql.c:539:44: incorrect:‘MYSQL_OPT_SSL_KEY’undeclared(The first use of)
mysql_options(&(self->connection), MYSQL_OPT_SSL_KEY, key);
^
src/MySQLdb/_mysql.c:539:44: footnote:每个undeclared的标识符在其出现的函数内只报告一次
src/MySQLdb/_mysql.c:540:44: incorrect:‘MYSQL_OPT_SSL_CERT’undeclared(The first use of)
mysql_options(&(self->connection), MYSQL_OPT_SSL_CERT, cert);
^
src/MySQLdb/_mysql.c:541:44: incorrect:‘MYSQL_OPT_SSL_CA’undeclared(The first use of)
mysql_options(&(self->connection), MYSQL_OPT_SSL_CA, ca);
^
src/MySQLdb/_mysql.c:542:44: incorrect:‘MYSQL_OPT_SSL_CAPATH’undeclared(The first use of)
mysql_options(&(self->connection), MYSQL_OPT_SSL_CAPATH, capath);
^
src/MySQLdb/_mysql.c:543:44: incorrect:‘MYSQL_OPT_SSL_CIPHER’undeclared(The first use of)
mysql_options(&(self->connection), MYSQL_OPT_SSL_CIPHER, cipher);
^
src/MySQLdb/_mysql.c:556:13: warnings:Implicitly declaring functions‘mysql_optionsv’ [-Wimplicit-function-declaration]
mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_ENFORCE, (void *)&enforce_tls);
^
src/MySQLdb/_mysql.c:556:49: incorrect:‘MYSQL_OPT_SSL_ENFORCE’undeclared(The first use of)
mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_ENFORCE, (void *)&enforce_tls);
^
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mysqlclient
Failed to build mysqlclient
ERROR: ERROR: Failed to build installable wheels for some based projects (mysqlclient)
settle (a dispute)
pip install mysqlclient==1.4.4
Success, just connect directly in the superSet visualization interface