centos7 java环境【jdk+maven+nacos】

java
https://blog.csdn.net/weixin_54514751/article/details/131400999
maven
https://maven.apache.org/index.html
https://blog.csdn.net/weixin_47316183/article/details/132129624
https://blog.csdn.net/weixin_47316183/article/details/120388222?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522169129690716800222829481%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=169129690716800222829481&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2blogfirst_rank_ecpm_v1~rank_v31_ecpm-1-120388222-null-null.268%5Ev1%5Ekoosearch&utm_term=maven&spm=1018.2226.3001.4450

nacos
参考连接
https://blog.csdn.net/wdquan19851029/article/details/122714741
https://blog.csdn.net/Ancoda/article/details/132255204

# 1、从官网下载nacos压缩包:nacos-server-2.2.3.tar.gz
https://github.com/alibaba/nacos/releases
 
# 2、上传到服务器并解压
tar -zxvf nacos-server-2.2.3.tar.gz
 
# 3、手动创建数据库,并执行脚本
/usr/local/nacos/conf/nacos-mysql.sql
 
# 4、修改application.properties配置文件
db.url.0=jdbc:mysql://localhost:3307/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user.0=ancoda
db.password.0=123456
 
# 5、进入bin目录,启动nacos
./startup.sh -m standalone
 
# 6、查看日志
/usr/local/nacos/nacos/logs的nacos.log
 
# 访问nacos服务
http://IP:8848/nacos

设置开机启动

vim   /lib/systemd/system/nacos.service

内容

[Unit]
Description=nacos
After=network.target
 
[Service] 
# java安装位置
Environment="JAVA_HOME=/usr/local/java/jdk1.8.0_321" 
Type=forking
#standalone 是单机,默认是集群cluster; nacos启动文件位置
ExecStart=/usr/local/nacos/bin/startup.sh -m standalone
ExecReload=/usr/local/nacos/bin/shutdown.sh
ExecStop=/usr/local/nacos/bin/shutdown.sh
PrivateTmp=true
              
[Install]
WantedBy=multi-user.target

重启nacos,设置开机启动

# 重启所有服务
systemctl daemon-reload
# 设置nacos开机自启动
systemctl enable nacos
# 查看nacos服务状态
systemctl status nacos
# 启动nacos服务
systemctl start nacos
# 停止nacos服务
systemctl stop nacos
# 重启nacos服务
systemctl restart nacos

你可能感兴趣的:(java,maven,开发语言)