java运维部署操作手册

    关闭防火墙

不管是windows还是linux,首先必须关闭防火墙

# linux添加8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent

#删除80端口
firewall-cmd --zone=public --remove-port=8080/tcp --permanent

# 刷新使端口立即生效
firewall-cmd --reload

JDK8安装

windows

找到【jdk-8u251-windows-x64.exe】,然后双击,一直点击【下一步】就行,不需要做任何修改,也不要修改安装路径。安装结束后,使用【CMD】命令,然后输入【java -version】,然后回车。出现了下面的版本号就表示JDK8安装完成。

linux安装

tar -zxvf jdk-8u144-linux-x64.tar.gz
vim /etc/profile
在文本的最后一行粘贴如下:
注意JAVA_HOME=/usr/java/jdk1.8.0_144 就是你自己的目录
#java environment
export JAVA_HOME=/usr/java/jdk1.8.0_144
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
然后按esc,输入【:wq】
然后输入source /etc/profile
再次输入java -version

mysql修改用户名账号密码

# 修改root账号密码
set password for 'root'@'localhost'=password('Rays@145!');
flush privileges;

set password for 'root'@'%'=password('Rays@145!');
flush privileges;


# 创建新用户并且授权
grant all privileges on *.* to 'ecs'@'%' identified by 'Rays@149!';
flush privileges;


# 如果修改或使用新的账号来连接canal,需要删除canal中的dat配置文件

mysql安装

windows

找到【mysql-installer-community-8.0.28.0.msi】,然后双击。

密码验证方式(Authentication Method)这一步很重要

第一个是强密码校验,mysql推荐使用最新的数据库和相关客户端,MySQL8换了加密插件,所以如果选第一种方式,很可能你的navicat等客户端连不上mysql8。

所以这里一定要选第二个(下图红框的地方),因为我们后面使用客户端navicat,它连接mysql数据库用的是就是这个加密算法,所以这一步很重要。(重要的事情说三遍)

设置的密码为统一的密码,统一密码在文档顶部。 

 如果出现下图红框的警告,表示名称重复了,换个其他名称

linux安装 

# 按照这个文章来
https://blog.csdn.net/renkai721/article/details/134133084

 sqlserver安装

 

 

 安装到指定的目录或者采用默认安装即可。

 密码请输入统一的密码

选择当前用户即可。 

 

 

安装好之后连接MYSQL数据库,修改root账号连接为所有机器可连接。如果不修改,其它机器是无法通过root账号连接mysql的。 

-- 一定要在安装的mysql机器上安装navicat,mysql默认不能其它路径访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

FLUSH PRIVILEGES;

 修改完之后,一定要使用navicat新建一个通过IP连接的连接来测试是否可以连接,比如在自己的电脑上,插上网线,保证自己的电脑和MYSQL所在的机器在同一个IP网段内。

canal-server安装 

复制【canal-server-prod】文件夹到需要安装的地方。

然后打开【canal-server-prod\canal\conf\ecs\instance.properties】文件,txt编辑或者editplus或vscode工具都行。

启动只需要双击【startup.bat】即可。数据库都没有导入前不要启动。

修改程序的配置文件

修改配置文件中的所有数据库和redis的连接地址,端口,密码。修改服务间的调用的IP

 redis安装

windows

直接双击【Redis-x64-7.0.2.exe】就行,一步一步安装。

安装完成后不要启动,然后在进程中找到【redis-server.exe】,然后结束任务。如果没有忽略该步骤。

修改密码方法:--------------------------------必须修改密码

在计划任务中暂时停止Auto_Run_RedisServer【没有忽略】

在任务管理器中停止redis-server.exe进程

# 以下2个文件都要修改
# 修改安装文件中的conf文件(redis.windows-service.conf 和redis.windows.conf)中 905行
# requirepass foobared
# 将前面的#号移除即可实现设置密码的效果。如:
requirepass Rays@123!
# 则密码为Rays@123!

在计划任务中启用Auto_Run_RedisServer服务,如果没有该服务直接双击【RunRedisServer.exe】即可启动

至此,修改密码步骤完成。

redis客户端工具安装

双击【redisdesktop.exe】软件,一直按照提示安装即可,安装完成后记得连接redis,测试一下。

 linux安装

Redis下载地址:https://redis.io/download/,或者使用命令直接下载:

cd /opt/software
wget http://download.redis.io/releases/redis-7.0.6.tar.gz

yum install gcc

# 解压
tar -zxvf redis-7.0.6.tar.gz
cd redis-7.0.6
# 编译安装
make

# 修改配置文件
port 6380
# 注释掉
# bind 127.0.0.1 
pidfile /var/run/redis_6380.pid
requirepass iot#2023!
# 增加redis callback功能
notify-keyspace-events Ex

# 后台启动命令
/opt/redis-7.0.6/src/redis-server /opt/redis-7.0.6/redis.conf --daemonize yes
# 关闭命令
pkill redis-server
kill redis-server进程号
# 查看进程id
ps -ef|grep redis
kill -9 进程id

MYSQL新建数据库

设置字符集

MYSQL导入数据库脚本

SQLSERVER新建数据库

应用程序打包部署

dys-server部署

打包后jar文件地址

Windows机器发布

进入到wharfIntf.jar所在的文件夹,在空白处右键,选择【在终端中打开】,然后输入启动命令,其中的test为自己需要启动连接的环境。

java -Xms512m -Xmx512m -XX:PermSize=128m -jar wharfIntf.jar --spring.profiles.active=test

关闭服务

Windows关闭服务比较简单,直接关闭CMD窗口就行。

windows启动关闭命令

启动脚本

1、新建一个txt文件,把下面的命令复制进去

2、修改文件中对应的jar包名称和jar包路径

3、保存

4、将startup.txt文件修改为后缀为startup.bat文件

5、双击运行

6、不会有任何窗口弹出,都是后台隐藏式运行。

7、等待20秒到1分钟左右,打开浏览器输入http://ip:pot/项目名/test/welcome

8、如果看到有返回的json消息,说明项目启动成功。也可以查看启动日志。

@echo off

setlocal enabledelayedexpansion
for /f "tokens=1" %%a in ('jps ^| findstr dyecs.jar') do taskkill /f /pid %%a

start javaw -Xms512m -Xmx1024m -jar D:\server\dyecs.jar --spring.profiles.active=prod > D:\server\logs\dyecs.log 2>&1 &

exit

停止脚本

只要修改7070为自己项目的端口号

@echo off
set port=7070
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
 echo kill the process %%m who use the port 
 taskkill /pid %%m -t -f
 goto q
)
:q

重启脚本

注意修改端口号,项目名称,项目路径,启动环境

@echo off
set port=7070
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
 echo kill the process %%m who use the port 
 taskkill /pid %%m -t -f
 goto start
)
:start
  
START "wharfmng" javaw -Xms512m -Xmx512m -XX:PermSize=128m -jar D:/java_code/wharfmng/target/wharfmng.jar --spring.profiles.active=dev

备注

1、一般把这三个文件,放在和jar包同级目录

Linux启动命令脚本

启动命令

1、根据自己的项目地址,修改对应的路径和项目名称

2、把下面的命令复制到新建的startup.txt文件中,然后修改文件为startup.sh

3、把文件上传到需要的文件夹下,下文的demo中,需要把startup.sh文件保存在/home/wharfmng-server/startup.sh

4、上传完文件后,需要修改对应的文件夹和文件的权限为777

nohup java -jar -Xms512m -Xmx512m -XX:PermSize=128m /home/wharfmng-server/wharfmng-service/wharfmng.jar --spring.profiles.acive=prod >> /dev/null 2>&1 &

5、给文件夹赋予777读写权限,只有第一次新建文件或文件夹,或者删除了文件,修改了文件名之后重新上传文件,都需要赋权777.

chmod -R 777 /home/wharfmng-server

6、准备好之后,启动命令如下

sh /home/wharfmng-server/startup.sh

7、查看日志

tail -f /home/wharfmng-server/logs/wahrfmng.log

8、退出日志查看,直接同时按下Ctrl+C按键就行。

停止命令 

ps -ef|grep java回车
root 54345 1 15 15:43 pts/0 00:03:08 java -Xms512m -Xmx512m -XX:Perm Size=128m -jar /home/wharfmng-server/wharfmng-service/wharfmng.jar --spring.profiles.active=prod
#注意查看进程ID,ID每次都会变,不要关闭其它的项目
#如果要关闭54345的进程
kill -9 54345回车

结束

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

package cn.renkai721.bean.vo;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MakeUpTheWordCount {

    private String make_up_the_word_count_column_999999999_1;
    private String make_up_the_word_count_column_999999999_2;
    private String make_up_the_word_count_column_999999999_3;
    private String make_up_the_word_count_column_999999999_4;
    private String make_up_the_word_count_column_999999999_5;
    private String make_up_the_word_count_column_999999999_6;
    private String make_up_the_word_count_column_999999999_7;
    private String make_up_the_word_count_column_999999999_8;
    private String make_up_the_word_count_column_999999999_9;
    private String make_up_the_word_count_column_999999999_10;
    private String make_up_the_word_count_column_999999999_11;
    private String make_up_the_word_count_column_999999999_12;
    private String make_up_the_word_count_column_999999999_13;
    private String make_up_the_word_count_column_999999999_14;
    private String make_up_the_word_count_column_999999999_15;
    private String make_up_the_word_count_column_999999999_16;
    private String make_up_the_word_count_column_999999999_17;
    private String make_up_the_word_count_column_999999999_18;
    private String make_up_the_word_count_column_999999999_19;
    private String make_up_the_word_count_column_999999999_20;

    public String getMake_up_the_word_count_column_999999999_1() {
        return make_up_the_word_count_column_999999999_1;
    }

    public void setMake_up_the_word_count_column_999999999_1(String make_up_the_word_count_column_999999999_1) {
        this.make_up_the_word_count_column_999999999_1 = make_up_the_word_count_column_999999999_1;
    }

    public String getMake_up_the_word_count_column_999999999_2() {
        return make_up_the_word_count_column_999999999_2;
    }

    public void setMake_up_the_word_count_column_999999999_2(String make_up_the_word_count_column_999999999_2) {
        this.make_up_the_word_count_column_999999999_2 = make_up_the_word_count_column_999999999_2;
    }

    public String getMake_up_the_word_count_column_999999999_3() {
        return make_up_the_word_count_column_999999999_3;
    }

    public void setMake_up_the_word_count_column_999999999_3(String make_up_the_word_count_column_999999999_3) {
        this.make_up_the_word_count_column_999999999_3 = make_up_the_word_count_column_999999999_3;
    }

    public String getMake_up_the_word_count_column_999999999_4() {
        return make_up_the_word_count_column_999999999_4;
    }

    public void setMake_up_the_word_count_column_999999999_4(String make_up_the_word_count_column_999999999_4) {
        this.make_up_the_word_count_column_999999999_4 = make_up_the_word_count_column_999999999_4;
    }

    public String getMake_up_the_word_count_column_999999999_5() {
        return make_up_the_word_count_column_999999999_5;
    }

    public void setMake_up_the_word_count_column_999999999_5(String make_up_the_word_count_column_999999999_5) {
        this.make_up_the_word_count_column_999999999_5 = make_up_the_word_count_column_999999999_5;
    }

    public String getMake_up_the_word_count_column_999999999_6() {
        return make_up_the_word_count_column_999999999_6;
    }

    public void setMake_up_the_word_count_column_999999999_6(String make_up_the_word_count_column_999999999_6) {
        this.make_up_the_word_count_column_999999999_6 = make_up_the_word_count_column_999999999_6;
    }

    public String getMake_up_the_word_count_column_999999999_7() {
        return make_up_the_word_count_column_999999999_7;
    }

    public void setMake_up_the_word_count_column_999999999_7(String make_up_the_word_count_column_999999999_7) {
        this.make_up_the_word_count_column_999999999_7 = make_up_the_word_count_column_999999999_7;
    }

    public String getMake_up_the_word_count_column_999999999_8() {
        return make_up_the_word_count_column_999999999_8;
    }

    public void setMake_up_the_word_count_column_999999999_8(String make_up_the_word_count_column_999999999_8) {
        this.make_up_the_word_count_column_999999999_8 = make_up_the_word_count_column_999999999_8;
    }

    public String getMake_up_the_word_count_column_999999999_9() {
        return make_up_the_word_count_column_999999999_9;
    }

    public void setMake_up_the_word_count_column_999999999_9(String make_up_the_word_count_column_999999999_9) {
        this.make_up_the_word_count_column_999999999_9 = make_up_the_word_count_column_999999999_9;
    }

    public String getMake_up_the_word_count_column_999999999_10() {
        return make_up_the_word_count_column_999999999_10;
    }

    public void setMake_up_the_word_count_column_999999999_10(String make_up_the_word_count_column_999999999_10) {
        this.make_up_the_word_count_column_999999999_10 = make_up_the_word_count_column_999999999_10;
    }

    public String getMake_up_the_word_count_column_999999999_11() {
        return make_up_the_word_count_column_999999999_11;
    }

    public void setMake_up_the_word_count_column_999999999_11(String make_up_the_word_count_column_999999999_11) {
        this.make_up_the_word_count_column_999999999_11 = make_up_the_word_count_column_999999999_11;
    }

    public String getMake_up_the_word_count_column_999999999_12() {
        return make_up_the_word_count_column_999999999_12;
    }

    public void setMake_up_the_word_count_column_999999999_12(String make_up_the_word_count_column_999999999_12) {
        this.make_up_the_word_count_column_999999999_12 = make_up_the_word_count_column_999999999_12;
    }

    public String getMake_up_the_word_count_column_999999999_13() {
        return make_up_the_word_count_column_999999999_13;
    }

    public void setMake_up_the_word_count_column_999999999_13(String make_up_the_word_count_column_999999999_13) {
        this.make_up_the_word_count_column_999999999_13 = make_up_the_word_count_column_999999999_13;
    }

    public String getMake_up_the_word_count_column_999999999_14() {
        return make_up_the_word_count_column_999999999_14;
    }

    public void setMake_up_the_word_count_column_999999999_14(String make_up_the_word_count_column_999999999_14) {
        this.make_up_the_word_count_column_999999999_14 = make_up_the_word_count_column_999999999_14;
    }

    public String getMake_up_the_word_count_column_999999999_15() {
        return make_up_the_word_count_column_999999999_15;
    }

    public void setMake_up_the_word_count_column_999999999_15(String make_up_the_word_count_column_999999999_15) {
        this.make_up_the_word_count_column_999999999_15 = make_up_the_word_count_column_999999999_15;
    }

    public String getMake_up_the_word_count_column_999999999_16() {
        return make_up_the_word_count_column_999999999_16;
    }

    public void setMake_up_the_word_count_column_999999999_16(String make_up_the_word_count_column_999999999_16) {
        this.make_up_the_word_count_column_999999999_16 = make_up_the_word_count_column_999999999_16;
    }

    public String getMake_up_the_word_count_column_999999999_17() {
        return make_up_the_word_count_column_999999999_17;
    }

    public void setMake_up_the_word_count_column_999999999_17(String make_up_the_word_count_column_999999999_17) {
        this.make_up_the_word_count_column_999999999_17 = make_up_the_word_count_column_999999999_17;
    }

    public String getMake_up_the_word_count_column_999999999_18() {
        return make_up_the_word_count_column_999999999_18;
    }

    public void setMake_up_the_word_count_column_999999999_18(String make_up_the_word_count_column_999999999_18) {
        this.make_up_the_word_count_column_999999999_18 = make_up_the_word_count_column_999999999_18;
    }

    public String getMake_up_the_word_count_column_999999999_19() {
        return make_up_the_word_count_column_999999999_19;
    }

    public void setMake_up_the_word_count_column_999999999_19(String make_up_the_word_count_column_999999999_19) {
        this.make_up_the_word_count_column_999999999_19 = make_up_the_word_count_column_999999999_19;
    }

    public String getMake_up_the_word_count_column_999999999_20() {
        return make_up_the_word_count_column_999999999_20;
    }

    public void setMake_up_the_word_count_column_999999999_20(String make_up_the_word_count_column_999999999_20) {
        this.make_up_the_word_count_column_999999999_20 = make_up_the_word_count_column_999999999_20;
    }
}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: itop运维系统操作手册是一份详细介绍itop运维系统使用方法和操作步骤的文档。它提供了对itop系统的全面指导,帮助用户熟悉和掌握系统各项功能。 手册首先介绍了itop系统的基本概念和功能,包括如何登录系统、查看和管理资产、配置和运行工作流等。接着,手册详细说明了每个模块的使用方法,包括资产管理、问题管理、变更管理、服务目录等。对于每个功能都提供了步骤和操作示例,方便用户理解和操作。 手册还涵盖了一些高级功能和设置,比如用户权限管理、定时任务配置、报表生成等。这些功能可以帮助用户进行更复杂的操作和管理,提高工作效率和准确性。 此外,手册还提供了一些常见问题和故障排除指南,帮助用户在使用过程中遇到问题时快速解决。 itop运维系统操作手册的编写方式简洁明了,用语通俗易懂,适合各种使用者阅读。手册中还加入了大量的截图和示例,以帮助用户更好地理解和操作系统。 总之,itop运维系统操作手册是一份非常实用的文档,对于初学者和有一定经验的用户都非常有帮助。通过阅读手册,用户能够轻松地掌握itop系统的使用方法,提高运维工作的效率和质量。 ### 回答2: iTop运维系统操作手册是一本详细介绍和指导使用iTop运维系统的指南。这个系统可以帮助企业管理和维护他们的IT基础设施,包括硬件设备、软件系统和网络设备等。 手册首先会介绍iTop运维系统的基本概念和功能,例如如何创建和管理用户账号、授权访问权限以及系统设置等。它还会详细介绍系统的界面和主要功能模块,如资产管理、问题跟踪、变更管理、服务管理和报表等等。 在手册中,会详细介绍每个功能模块的操作步骤和使用技巧。例如,在资产管理模块中,手册会告诉用户如何添加和管理设备、软件、许可证等信息;在问题跟踪模块中,手册会介绍如何创建和处理问题工单;而在变更管理模块中,手册会指导用户如何提出和执行变更请求等等。 此外,手册还会介绍一些高级功能和技术,比如如何进行自定义配置、如何与其他系统集成以及如何利用API接口进行扩展等等。这些内容将帮助用户更好地利用iTop运维系统来满足公司的需求。 总之,iTop运维系统操作手册是一本详尽的指南,能够帮助用户熟悉并掌握该系统的使用方法和技巧,确保企业能够充分利用iTop系统进行IT基础设施的管理和维护工作。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

renkai721

谢谢您的打赏!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值