国产服务器安装软件简单记录(银河麒麟服务器版V10+FT2000)

国产服务器安装软件简单记录(银河麒麟服务器版V10+FT2000)

1、 远程工具,向日葵安装包问麒麟软件客服要的,todesk软件包是从官网下载的

1.1 向日葵
安装命令
rpm -ivh sunloginclient-10.0.2-24779.aarch64.rpm
安装输出信息,表明是开机自启,但是使用过程中,并不会开机自启。应该有bug
Created symlink /etc/systemd/system/multi-user.target.wants/runsunloginclient.service → /etc/systemd/system/runsunloginclient.service

1.2 todesk
官网地址
https://www.todesk.com/linux.html
安装命令
rpm -ivh todesk-v4.3.1.0-arm64.rpm
这个开机自启管用
Created symlink /etc/systemd/system/multi-user.target.wants/todeskd.service → /etc/systemd/system/todeskd.service

1.3 tigervnc
系统中自带tigervnc,可以在局域网与windows系统之间的相互远程控制
软件下载地址
https://sourceforge.net/projects/tigervnc/files/stable/1.12.0/

2、安装redis(4.0.11)
yum install redis
systemctl status redis
systemctl start redis
systemctl stop redis
systemctl enable redis
Created symlink /etc/systemd/system/multi-user.target.wants/redis.service → /usr/lib/systemd/system/redis.service.
配置文件 /etc/redis.conf
如果想让其他机器访问
protected-mode no # 由yes改为no
bind 127.0.0.1 # 注释掉
requirepass foobared # 默认注释了,可以设置密码

3、安装nginx(1.16.1)
yum install nginx
systemctl status nginx
systemctl start nginx
systemctl stop nginx
systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
配置文件 /etc/nginx/nginx.conf
conf.d和default.d文件夹为空
主要编辑nginx.conf就可以了
默认root目录 /usr/share/nginx/html

4、安装tomcat(tomcat9.0.10)
yum install tomcat
systemctl status tomcat
systemctl start tomcat
systemctl stop tomcat
systemctl enable tomcat
Created symlink /etc/systemd/system/multi-user.target.wants/tomcat.service → /usr/lib/systemd/system/tomcat.service.
配置文件 /etc/tomcat/server.xml
webapp路径 /var/lib/tomcat/webapps
运行报错,加一个secretRequired=““属性
<Connector protocol=“AJP/1.3”
address=”::1”
port=“8009”
redirectPort=“8443”
secretRequired=“”/>

5、卸载mariadb(卸载后,系统出现了一些问题。激活的系统显示未激活、中文输入法消失,可能依赖卸载多了。重装了系统,使用了自带的maridb,参考9)
服务器中默认安装有mariadb10.3.9
①systemctl disable mariadb
②yum remove mariadb 卸载mariadb
③yum list installed | grep mariadb
发现还有mariadb-connector-c.aarch64
yum remove mariadb-connector-c.aarch64
④rm -rf /etc/my.cnf 已经没有了
⑤rm -rf $(find / -name mysql) 删除所有包含mysql的文件(夹)
/var/lib/pcp/config/pmlogconf/mysql
/var/lib/selinux/targeted/active/modules/100/mysql
/var/lib/selinux/ukmcs/active/modules/100/mysql
/usr/share/bash-completion/completions/mysql
⑥reboot

6、安装mysql8.0
wget https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
rpm -Uvh mysql80-community-release-el7-2.noarch.rpm
yum repolist all | grep mysql
yum install mysql-community-server
配置文件
/etc/my.cnf
/etc/my.cnf.d(里面没有文件)
default-authentication-plugin
port
lower_case_table_names
sql_mode
进行设置
systemctl status mysqld
systemctl start mysqld
查找临时密码
cat /var/log/mysqld.log | grep password
alter user ‘root’@‘localhost’ identified by ‘1234’;
flush privileges;
update user set host=‘%’ where user=‘root’;
使用其他地方的客户端连接

7、关闭防火墙(测试连接redis、mysql时需要关闭防火墙)
systemctl stop firewalld
开启防火墙
systemctl start firewalld
为了调试方便,直接关掉了firewall,生产环境只需要开启特定几个端口即可

8、设置数据目录权限 777
chmode 777 /data

9、使用mariadb数据库 版本10.3.9
配置文件
/etc/my.cnf.d/mariadb-server.cnf
# 只配置当前版本的mariadb
# This group is only read by MariaDB-10.3 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don’t understand
[mariadb-10.3]
# 端口号
port = 3376
#lower_case_table_names=0 表名存储为给定的大小和比较是区分大小写的
#lower_case_table_names=1 表名存储在磁盘是小写的,但是比较的时候是不区分大小写
#lower_case_table_names=2 表名存储为给定的大小写但是比较的时候是小写的
## 默认值是0,为了与开发环境兼容,这里修改成了1
lower_case_table_names=1
#默认有更多的限制,为了与开发环境兼容,做了调整
sql_mode = “STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION”

查看状态
systemctl status mariadb
启动
systemctl start mariadb
停止
systemctl stop mariadb
设置开机启动
systemctl enable mariadb
设置开机启动输出的信息
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service
禁止开机启动
systemctl disable mariadb
禁止开机启动输出的信息
Removed /etc/systemd/system/multi-user.target.wants/mariadb.service.
Removed /etc/systemd/system/mysql.service.
Removed /etc/systemd/system/mysqld.service.

10、项目中做的变更

	<!-- Mariadb驱动 -->
	<dependency>
		<groupId>org.mariadb.jdbc</groupId>
		<artifactId>mariadb-java-client</artifactId>
		<scope>runtime</scope>
	</dependency>

配置文件
driverClassName: org.mariadb.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3376/file_system?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8
username: root
password: 1234

11、 程序服务器部署后,无法连接到数据库
程序部署到本机使用root用户连接不上mariadb数据库,发现user表中有好几个root用户,其中Host为localhost的被我改成了%,并设置了密码,其他的密码为空。远程连接、服务器本地命令连接都可以,就是运行程序无法连接。后采取了两个措施。
1、新建了一个其他用户名,可以连接数据库了
2、因为url中使用的ip是127.0.0.1,把user表中host是127.0.0.1的root用户密码设置为配置文件对应的密码,这样也可以连接了。
3、设置密码的时候,甭管Host是什么,统一用户名的设置一样的密码。这样它内部怎么匹配,应该都能登录了吧。

小尾巴~~
只要有积累,就会有进步

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值