首页 > 其他分享 >银河麒麟os V10-SP1使用记录

银河麒麟os V10-SP1使用记录

时间:2022-10-10 14:57:04浏览次数:50  
标签:kylin SP1 V10 sudo nginx mysql home docker os

> cat /etc/kylin-build
Kylin-Desktop V10-SP1
Build 20220316

> cat /etc/.kyinfo
[dist]
name=Kylin
milestone=Desktop-V10-SP1-General-RC6-Build21-2203
arch=arm64
beta=False
time=2022-03-16 16:54:55
dist_id=Kylin-Desktop-V10-SP1-General-RC6-Build21-2203-arm64-2022-03-16 16:54:55

[servicekey]
key=0316010

[os]
to=
term=2023-06-20

> cat /proc/version
Linux version 5.4.18-53-generic (buildd@localhost) (gcc version 9.3.0 (Ubuntu 9.3.0-10kylin2)) #42-KYLINOS SMP Fri Mar 4 06:09:02 UTC 2022

> uname -a
Linux kylin-mcbfb02 5.4.18-53-generic #42-KYLINOS SMP Fri Mar 4 06:09:02 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

> cat /etc/issue
Kylin V10 SP1 \n \l

> lsb_release -a
No LSB modules are available.
Distributor ID: Kylin
Description: Kylin V10 SP1
Release: v10
Codename: kylin

> whereis docker
docker: /etc/docker # 可能是之前使用的公司没有删除干净

> sudo rm -rf /etc/docker # 删掉未删除的docker程序包或配置文件

> whereis docker
docker:

sudo apt-get clean
# 卸载本机的mysql,自己鉴别是否需要执行,sudo apt-get purge -y 'mysql*'
sudo apt-get update
#卸载docker
dpkg -l | grep docker
sudo apt remove -y --purge xxx #上面的输出
# 下面的语句也可以试一下
sudo apt-get remove docker
sudo apt remove docker-ce
# 安装docker
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
# 下载mysql镜像
docker pull mysql
# 如果下载镜像失败,则需要从其他服务器先执行 下面操作在其他服务器
docker pull mysql
docker save -o mysql.tar mysql
# 使用xftp将mysql.tar文件下载下来,然后上传到麒麟linux的/home/kylin/SC/docker目录
# 下面操作在麒麟服务器
cd /home/kylin/SC/docker
docker load < mysql.tar
docker load < busterslim.tar
# 先运行ysql,将里面的配置文件和data映射到本地 mysql密码不能用大写,不能用特殊字符
# mysql 8.0的配置文件路径是/etc/mysql/conf.d,data文件路径是/var/lib/mysql
cd /home/kylin/SC/mysql && rm -rf conf.d && rm -rf data
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=你的密码 --name t_mysql mysql --lower_case_table_names=1
docker exec -it t_mysql /bin/bash

mysql -u root -p
show global variables like '%lower_case%'; #查看是否大小写敏感
show variables like '%time_zone%'; # 查看时区
set global time_zone = '+8:00';
set time_zone = '+8:00';
flush privileges;
show variables like '%time_zone%';

docker cp t_mysql:/etc/mysql/conf.d /home/kylin/SC/mysql/conf.d
docker cp t_mysql:/var/lib/mysql /home/kylin/SC/mysql/data
#然后停止并删除之前的mysql
docker stop $(docker ps -aqf "name=t_mysql") && docker rm $(docker ps -aqf "name=t_mysql")
# 再运行mysql,此时将映射添加上
docker run -d \
    -p 3306:3306 \
    --name mysql \
    -v /home/kylin/SC/mysql/conf.d:/etc/mysql/conf.d \
    -v /home/kylin/SC/mysql/data:/var/lib/mysql \
    -e MYSQL_ROOT_PASSWORD=你的密码 \
    --restart always  \
    mysql --lower_case_table_names=1 
docker exec -it mysql /bin/bash

docker ps -a
docker stop $(docker ps -aqf "name=mysql")
docker rm $(docker ps -aqf "name=mysql")


sudo dockerd --debug


vim /etc/default/grub
# 修改GRUB_CMDLINE_LINUX_SECURITY="audit=0 security="为GRUB_CMDLINE_LINUX_SECURITY="audit=0 security=kesec"
update-grub
reboot


#安装curl
sudo apt-get -y install curl
# 下载并安装.net 5 运行时
mkdir /home/kylin/SC && cd /home/kylin/SC
# 下载.net 5 运行时 或者使用文件传输工具将压缩包上传到linux
wget https://download.visualstudio.microsoft.com/download/pr/6eb8aee2-cbea-4c4f-9bb9-ea6229ec229b/d6c438e5071c359ad995134f0a33e731/aspnetcore-runtime-5.0.17-linux-arm64.tar.gz

# 压缩并添加环境变量
mkdir -p "$HOME/dotnet" && tar zxf aspnetcore-runtime-5.0.17-linux-arm64.tar.gz -C "$HOME/dotnet"
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

cd /etc/systemd/system/ && sudo cat << EOF > net-webadmin.service
[Unit]
Description=webadmin .NET Web API App running on Ubuntu
[Service]
WorkingDirectory=/home/kylin/SC/api/webadmin
ExecStart=/home/kylin/dotnet/dotnet /home/kylin/SC/api/admin/WebApi.dll --urls http://0.0.0.0:8000
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
SyslogIdentifier=dotnet-web api
User=kylin
Environment=ASPNETCORE_ENVIRONMENT=Development
[Install]
WantedBy=multi-user.target
EOF

# The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.
# https://blog.csdn.net/small_kidy/article/details/118933366
# 可以使用这个命令进行测试 /home/kylin/dotnet/dotnet /home/kylin/SC/api/webadmin/CMTMC.AdminWebApi.dll
# 刷新配置
systemctl daemon-reload
# 设置开机启动
systemctl enable net-webadmin.service
# 重启
systemctl restart net-webadmin.service
# 查看状态
systemctl status net-webadmin.service
# 停止
systemctl stop net-webadmin.service
# 启动
systemctl start net-webadmin.service
systemctl disable net-webadmin.service



# 安装nginx
# nginx
mkdir nginx && cd nginx
sudo apt-get install -y nginx
nginx -v 
# 输出1.18.0
sudo service nginx start
# 彻底卸载 apt-get --purge autoremove nginx
# nginx文件安装完成之后的文件位置
#/usr/sbin/nginx:主程序
#/etc/nginx:存放配置文件
#/usr/share/nginx:存放静态文件
#/var/log/nginx:存放日志
# 上创nginx的conf文件路径/etc/nginx/conf.d/sc.conf

# 需要使用root
# 使用root更改sc.conf配置
sudo cd /etc/nginx/conf.d && cat << EOF > sc.conf
server {
    listen       8000;
    location / {
        root   /home/kylin/SC/web/webadmin;
        index  index.html index.htm;
    }
}

server {
    listen       9001;
    location / {
        root   /home/kylin/SC/web/web;
        index  index.html index.htm;
    }
}
EOF

# 使用kylin
vim /etc/nginx/nginx.conf
#按i键开始修改,把第一行的user www-data;更改为user kylin;然后按esc键,输入:wq保存并退出
# 更改配置文件后刷新nginx
sudo nginx -s reload

标签:kylin,SP1,V10,sudo,nginx,mysql,home,docker,os
From: https://www.cnblogs.com/spatxos/p/16775675.html

相关文章

  • CentOS 7.9 安装 docker-20.10.12
    一、CentOS7.9安装docker-20.10.12地址https://www.docker.comhttps://hub.docker.com 二、环境查看系统内核是3.10以上的[root@ecs-65685~]#uname-aLi......
  • centos7安装neo4j
    1、下载tar包wgethttps://neo4j.com/artifact.php?name=neo4j-community-3.4.9-unix.tar.gz2、解压并移动位置tar-zxvf neo4j-community-3.4.9-unix.tar.gzmvneo4j......
  • HttpPost 帮助类
    1publicstaticclassClientHelper2{3publicstaticstringHttpPost(stringurl,stringcontent)4{5stringresul......
  • CentOS之开启firewalld白名单
    title:CentOS之开启firewalld白名单categories:CentOStags:CentOStop:40CentOS之开启firewalld白名单​ Firewalld是可用于许多Linux发行版的防火墙管理解决......
  • CentOS增加分区空间
    title:CentOS增加分区空间categories:CentOStags:CentOStop:40CentOS增加分区空间CentOS增加home的分区空间给/根目录1.umouthome目录umount/home2.删除/h......
  • CentOS设置服务守护进程
    title:CentOS设置服务守护进程categories:CentOStags:CentOSCentOS设置服务守护进程一.介绍Systemctl是linux系统继init.d之后的一个systemd工具,主要负责控制syst......
  • CentOS配置硬盘自动挂载
    title:CentOS配置硬盘自动挂载categories:CentOStags:CentOStop:30CentOS配置硬盘自动挂载1.查看Linux硬盘信息sudofdisk-l2.格式化新硬盘**(很危险,注意操......
  • 目标检测新方式 | class-agnostic检测器用于目标检测(附论文下载链接)
    计算机视觉研究院专栏作者:Edison_G目标检测模型在定位和分类训练期间显示目标时表现良好,然而,由于创建和注释检测数据集的难度和成本,训练过的模型检测到数量有限的目标类型,未......
  • CentOS配置本地yum源
    title:CentOS配置本地yum源categories:[CentOS]tags:CentOStop:20CentOS配置本地yum源为了方便测试与开发,常常需要在虚拟机上安装各种开发环境,如果没有yum源......
  • CentOS免密登录
    title:CentOS免密登录categories:CentOStags:CentOSCentOS免密登录#!/bin/shpass=root123yuminstallexpect-yecho"y"|ssh-keygen-trsa-P""-f/root/.......