――Ich möchte dies und das der Firma mit Python machen --Operate GitLab (Aggregat- und Post-Probleme)
OS Version
[root@XXX ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
--Wenn Sie die Version angeben, können Sie aus Repository auswählen.
[root@XXX tmp]# cd /tmp
[root@XXX tmp]# curl https://repo.anaconda.com/archive/Anaconda3-5.3.1-Linux-x86_64.sh -O
Install
[root@XXX tmp]# bash ./Anaconda3-5.3.1-Linux-x86_64.sh
--Interaktiver Formatauszug unten
Please, press ENTER to continue
>>> *Männlich eingeben
Do you approve the license terms? [yes|no]
>>>yes
Anaconda3 will now be installed into this location:
/root/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/root/anaconda3] >>> *Männlich eingeben
Do you wish the installer to initialize Anaconda3
in your /root/.bashrc ? [yes|no]
[no] >>> yes
[root@XXX tmp]# source ~/.bashrc
[root@XXX tmp]# anaconda -V
anaconda Command line client (version 1.7.2)
[root@XXX tmp]# jupyter --version
4.4.0
[root@XXX tmp]# jupyter --path
config:
/root/.jupyter
/root/anaconda3/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/root/.local/share/jupyter
/root/anaconda3/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/run/user/0/jupyter
――Der Punkt ist, den Betrieb aufzunehmen, bevor eine beängstigende Person fragt: "Ist diese Sicherheit in Ordnung?" (Nebenbei)
--Pytnons Bibliothek, die Passwörter interaktiv hascht
[root@XXX ~]# ipython
Python 3.7.0 (default, Jun 28 2018, 13:15:42)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:8e9f3XXXXXXXXXXXXXXXXXXXXXXXX'
In [3]: exit
touch
erstellen und von Hand einstellen.[root@XXX tmp]# jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
/ root / .jupyter / jupyter_notebook_config.py
beschriebenc = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888 #Defalt
c.NotebookApp.password = u'sha1:8e9f3XXXXXXXXXXXXXXXXXXXXXXXX'
c.NotebookApp.notebook_dir = '/root/jupyter_files/'
jupyter_notebook_config.py
geschrieben haben[root@XXX ~]# firewall-cmd --add-port=8888/tcp --zone=public --permanent
success
[root@XXX ~]# firewall-cmd --add-service=http --zone=public --permanent
success
[root@XXX ~]# firewall-cmd --reload
success
[root@XXX ~]# firewall-cmd --list-ports --zone=public
8888/tcp
[root@XXX ~]# jupyter notebook
#Wenn Sie als root angemeldet sind, benötigen Sie die Option ↓
[root@XXX ~]# jupyter notebook --allow-root
[I 10:17:31.193 NotebookApp] JupyterLab extension loaded from /root/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 10:17:31.194 NotebookApp] JupyterLab application directory is /root/anaconda3/share/jupyter/lab
[I 10:17:31.196 NotebookApp] Serving notebooks from local directory: /root/jupyter_files
[I 10:17:31.197 NotebookApp] The Jupyter Notebook is running at:
[I 10:17:31.197 NotebookApp] http://${hostname} or 127.0.0.1):8888/
[I 10:17:31.197 NotebookApp] The Jupyter Notebook is running at:
[I 10:17:31.197 NotebookApp] http://localhost:8888/
[root@XXX ~]# touch /etc/systemd/system/notebook.service
[root@XXX ~]# vi /etc/systemd/system/notebook.service
ExecStart
erfordert eine Option für root[Unit]
Description = Jupyter Notebook
[Service]
Type=simple
PIDFile=/var/run/jupyter-notebook.pid
ExecStart=/root/anaconda3/bin/jupyter notebook # `$ which jupyter`Bestätigen mit
WorkingDirectory=/root #Home-Verzeichnis der Benutzer, die Anaconda installiert haben(Sofort nach dem Login`$pwd`)
User=root #Benutzername, der Anaconda eingeführt hat`$ id`
Group=root #Gruppenname, zu dem der Benutzer gehört, der Anaconda eingeführt hat
Restart=always
[Install]
WantedBy = multi-user.target
[root@XXX ~]# $ systemctl list-unit-files --type=service
#Anlaufen
[root@XXX ~]# systemctl start notebook
#Bestätigung starten
[root@XXX ~]# systemctl status notebook
#Stellen Sie ein, dass beim Start automatisch gestartet wird
[root@XXX ~]# systemctl enable notebook
Recommended Posts