#yyds干货盘点#安装悟空CRM11

青春须早为,岂能长少年。这篇文章主要讲述#yyds干货盘点#安装悟空CRM11相关的知识,希望能为你提供帮助。
悟空CRM目录结构

wk_crm ├── admin-- 系统管理模块和用户管理模块 ├── authorization -- 鉴权模块,目前仅用于登录鉴权,后期可能有更改 ├── bi-- 商业智能模块 ├── core-- 通用的代码和工具类 ├── crm-- 客户管理模块 ├── examine-- 审批模块 ├── gateway-- 网关模块 ├── job-- 定时任务模块 ├── oa-- OA模块 └── work-- 项目管理模块

悟空CRM使用的主要技术栈
名称 版本 说明
spring-cloud-alibaba 2.2.1.RELEASE(Hoxton.SR3) 核心框架
swagger 2.9.2 接口文档
mybatis-plus 3.3.0 ORM框架
sentinel 2.2.1.RELEASE 断路器以及限流
nacos 1.2.1.RELEASE 注册中心以及分布式配置管理
seata 1.2.0 分布式事务
elasticsearch 2.2.5.RELEASE(6.8.6) 搜索引擎中间件
jetcache 2.6.0 分布式缓存框架
xxl-job 2.1.2 分布式定时任务框架
gateway 2.2.2.RELEASE 微服务网关
feign 2.2.2.RELEASE 服务调用
一、前置环境
  • Jdk1.8
  • Maven3.5.0+
  • mysql5.7.20 (数据库安装注意事项)
  • Redis(版本不限)
  • Elasticsearch 6.8.6 (环境配置注意事项)
  • Seata(1.2.0)(配置说明)
  • Sentinel(1.7.2)(项目中sentinel使用8079端口)
  • Nacos(1.2.1)
二、JDK安装1、去官网下载https://www.oracle.com下载jdk-8u60-linux-x64.tar.gz
2、安装
[root@localhost ruanjian]# tar zxvf jdk-8u60-linux-x64.tar.gz -C /opt/ #制作软连接 [root@localhost opt]# ln -s jdk1.8.0_60/ jdk #写入环境变量 [root@localhost opt]# vim /etc/profile export java_HOME=/opt/jdk1.8.0_271 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib export PATH=$JAVA_HOME/bin:$PATH [root@localhost opt]# source /etc/profile [root@localhost opt]# java -version java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

三、安装maven1、官网下载软件http://archive.apache.org/dist/maven/maven-3/3.5.4/binaries/
2、安装
[root@localhost opt]# tar zxvf apache-maven-3.5.4-bin.tar.gz -C /opt/ [root@localhost opt]# mv apache-maven-3.5.4/ maven #增加环境变量 [root@localhost maven]# vim /etc/profile export PATH=:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH (增加$MAVEN_HOME/bin) export MAVEN_HOME=/opt/maven [root@localhost maven]# source /etc/profile

四、安装Mysql数据库
#因本人需记录mysql源码安装步骤,所以采用源码安装。 1、安装依赖组件 [root@localhost maven]# yum install -y git cmake gcc gcc-c++ bison ncurses ncurses-devel bison-devel libaio-devel 2、mysql5.7需要安装boost库,这里下载的是含boost的源码包 https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.25.tar.gz[root@localhost local]# tar zxvf mysql-boost-5.7.25.tar.gz-C /usr/local/mysql3、创建用户 [root@localhost local]# useradd -s /sbin/nologin mysql4、创建数据存储目录,并设为mysql所有 [root@localhost /]# mkdir -p /data/mysql/data [root@localhost /]# chown -R mysql:mysql /data/mysql/5、切换至myslq目录下,编译安装 [root@localhost /]# cd /usr/local/mysql/ [root@localhost mysql]# cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=boost [root@localhost mysql]# make & & make install6、配置my.cnf文件 [client] port= 3306 socket= /data/mysql/mysql.sock[mysqld] port= 3306 socket= /data/mysql/mysql.sock user = mysqldatadir = /data/mysql/data basedir = /usr/local/mysql [mysqld_safe] pid-file = /usr/local/mysql/data/mysql.pid log_error = /usr/local/mysql/data/mysql-error.log -----------------------------------------------------------------7、更改mysql目录权限 [root@localhost local]# chown -R mysql:mysql mysql/8、初始化mysql [root@localhost bin]# cd /usr/local/mysql/bin/ [root@localhost bin]# ./mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data9、cp mysql可执行文件 [root@localhost support-files]# cp mysql.server /etc/init.d/mysqld [root@localhost init.d]# chmod 755 mysqld [root@localhost init.d]# cd /usr/local/mysql/data/ [root@localhost data]# touch mysql-error.log10、启动mysql,并加入开机自启 [root@localhost data]# service mysqld start [root@localhost data]# systemctl enable mysqld11、增加环境变量,只增加了$MYSQLD后面部分 [root@localhost /]# vim /etc/profile export PATH=:$JAVA_HOME/bin:$MAVEN_HOME/bin:$MYSQLD/bin:$PATH export MYSQLD=/usr/local/mysql [root@localhost /]# source /etc/profile12、给数据库设置密码 [root@localhost /]# mysqladmin -u root password "123456"13、关闭groub by报错,在my.cnf中增加内容 [root@localhost /]# vim /etc/my.cnf [mysqld] sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION14、创建crm所需数据库 mysql> create database nacos; mysql> create database seata; mysql> create database wk_crm_single; mysql> create database xxl_job; 15、授权用户crm能访问所有数据库 create user crm@localhost identified by 123.com.cn; grant all on *.* to crm@localhost identified by 123.com.cn;

五、安装Elasticsearch 6.8.61、下载地址 https://mirrors.huaweicloud.com/elasticsearch/
2、解压文件 [root@localhost ruanjian]# tar zxvf elasticsearch-6.8.6.tar.gz -C /opt/ [root@localhost opt]# mv elasticsearch-6.8.6/ elasticsearch 3、修改文件内存 [root@localhost elasticsearch]# vim config/jvm.options -Xms512M -Xmx512M 4、安装插件分词器 wget https://file.72crm.com/project/analysis-icu-6.8.6.zip #创建目录 [root@localhost plugins]# mkdir /opt/elasticsearch/plugins/analysis-icu #解压 [root@localhost analysis-icu]# unzip analysis-icu-6.8.6.zip #创建用户及组 [root@localhost analysis-icu]# groupadd es [root@localhost analysis-icu]# useradd esuser -g es -p elasticsearch [root@localhost analysis-icu]# chown -R esuser:es /opt/elasticsearch/ #运行,端口9300及9200 sudo-u esuser /bin/bash -c "source /etc/profile & & /bin/bash /opt/elasticsearch/bin/elasticsearch -d"

六、安装redis【#yyds干货盘点#安装悟空CRM11】?一、去网站下载redis:http://download.redis.io/releases/ 本次下载的是:redis-4.0.9.tar
?二、解压安装
[root@localhost ~]# yum -y install gcc-C++#安装依赖组件 [root@localhost ~/redis-4.0.9/src]# yum -y install tcl#安装依赖组件 [root@localhost ~]# tar zxvf redis-4.0.9.tar.gz [root@localhost ~]# cd redis-4.0.9 [root@localhost ~]# make [root@localhost ~/redis-4.0.9]# cd src [root@localhost ~/redis-4.0.9/src]# make test#安装测试 [root@localhost ~/redis-4.0.9/src]# make install PREFIX=/data/redis/[root@localhost ~/redis-4.0.9/src]# cd /data/redis#安装成功后进入文件中 [root@localhost /data/redis]# ls bin [root@localhost /data/redis]# mkdir etc#创建redis配置文件目录 [root@localhost /]# cd ~ [root@localhost ~]# cd redis-4.0.9 [root@localhost ~/redis-4.0.9]# mv redis.conf /data/redis_cluster/redis_6379/conf/#将配置文件移动到安装目录下 [root@localhost /]# cd /data/redis/etc [root@localhost /data/redis/etc]# vim redis.conf#将redis改为后台启动,将no改为yes daemonize yesredis.conf文件内容:------------------------------------------- #以守护进程模式启动 daemonize yes#绑定主机地址 bind 192.168.100.5 127.0.0.1#监听端 port 6379#pid和log文件所在路径 pidfile /data/redis/pid/redis_6379.pid logfile /data/redis/logs/redis_6379.log#设置数据库的数量,默认为0 databases 16#指定本地持久化文件的文件名,默认dump.rdb dbfilename redis_6379.rdb#本地数据库的目录,持久化文件路径 dir /data/redis/data------------------------------------------------------------------------------#配置redis开机自启 需将文件bin下的文件移动到/usr/local/bin/,/redis目录中的bin就可以删除 一、cd /usr/lib/systemd/system 二、创建redis.service这个文件,内容如下: ------------------------------------------------------------------------------ [Unit]Description=RedisAfter=network.target remote-fs.target nss-lookup.target[Service]Type=forkingExecStart=/usr/local/bin/redis-server /data/redis/etc/redis.confExecStop=kill -INT `cat /tmp/redis.pid`User=redisGroup=redis[Install]WantedBy=multi-user.target------------------------------------------------------------------------------ cd /etc/systemd/system #创建快捷方式 ln -s /usr/lib/systemd/system/redis.service redis.service #创建redis用户,useradd redis #将redis目录权限给到redis用户 [root@localhost /etc/systemd/system]# chown -R redis:redis /data/redis_cluster/redis_6379 #重新加载systemctl [root@localhost /etc/systemd/system]# systemctl daemon-reload #使用systemctl start redis 启动redis #设置开机自启:systemctl enable redis#启动redis,加入到systemctl后即可:systemctl start redis [root@localhost /opt/soft/redis/etc]# /usr/local/bin/redis-server /data/redis_cluster/redis_6379/conf/redis.conf #查看是否启动成功,6379端口是否正在监听 [root@localhost /opt/soft/redis/etc]# netstat -anpt | grep redis tcp00 127.0.0.1:63790.0.0.0:*LISTEN15486/redis-server #将redis目录下的redis-cli复制到命令目录中 [root@localhost bin]# cp redis-cli/usr/local/bin/ [root@localhost bin]# redis-cli 127.0.0.1:6379> #设置redis密码 127.0.0.1:6379> config set requirepass 123456 OK

七、安装NACOS一、下载
wget https://github.com/alibaba/nacos/releases/download/1.3.2/nacos-server-1.3.2.tar.gz

二、解压
[root@localhost nacos]# tar zxvf nacos-server-1.3.2.tar.gz -C /data/ #目录结构 nacos/ ├── bin │├── shutdown.cmd │├── shutdown.sh │├── startup.cmd │└── startup.sh//启动文件 ├── conf │├── application.properties │├── application.properties.example │├── cluster.conf.example │├── nacos-logback.xml │├── nacos-mysql.sql//数据文件 需要导入 │└── schema.sql ├── LICENSE ├── NOTICE └── target └── nacos-server.jar

三、初始化数据库
[root@localhost nacos]# cd conf/ #将nacos-mysql.sql导到nacos数据库中 [root@localhost conf]# mysql -uroot -p123456 mysql> use nacos; mysql> source /data/nacos/conf/nacos-mysql.sql#修改数据文件,将注释取消掉 [root@localhost conf]# vim application.properties spring.datasource.platform=mysql db.num=1 db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8& connectTimeout=1000& socketTimeout=3000& autoReconnect=true& useUnicode=true& useSSL=false& serverTimezone=UTC db.user=root db.password=123456

四、启动
#在bin下启动,使用端口8848[root@localhost bin]# startx -m standalone [root@localhost bin]# startup.sh -m standalone

#yyds干货盘点#安装悟空CRM11

文章图片

八、Seata安装一、下载
wget https://github.com/seata/seata/releases/download/v1.3.0/seata-server-1.3.0.zip #解压 [root@localhost data]# unzip seata-server-1.3.0_2.zip #移动 [root@localhost data]# mv seata /data #下载nacos配置文件进行注册,只下载nacos、config.txt https://github.com/seata/seata/tree/develop/script/config-center #执行导入脚本 [root@localhost seata]# cd /data/seata/nacos/ ./nacos-config.sh

查看nacos,说明注册成功
#yyds干货盘点#安装悟空CRM11

文章图片

二、修改配置文件
#其他内容需注销 [root@localhost conf]# vim /data/seata/conf/registry.conf registry # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa type = "nacos"nacos application = "seata-server" serverAddr = "127.0.0.1:8848" namespace = "public" group = "DEFAULT_GROUP" cluster = "default" username = "nacos" password = "nacos" config # file、nacos 、apollo、zk、consul、etcd3 type = "nacos" nacos serverAddr = "127.0.0.1:8848" namespace = "public" group = "DEFAULT_GROUP" username = "nacos" password = "nacos"------------------------------------------------------------#启动seate,端口8091 [root@localhost seata]# ./bin/seata-server.sh&

九、Sentinel安装一、下载
[root@localhost ruanjian]# wget https://github.com/alibaba/Sentinel/releases/download/v1.8.0/sentinel-dashboard-1.8.0.jar [root@localhost ruanjian]# mkdir -p /data/sentinel [root@localhost ruanjian]# cp sentinel-dashboard-1.8.0.jar /data/sentinel/ [root@localhost ruanjian]# cd /data/sentinel/ [root@localhost sentinel]# unzip sentinel-dashboard-1.8.0.jar #启动,端口8079 [root@localhost sentinel]# nohup java -Dserver.port=8079 -Dcsp.sentinel.dashboard.server=127.0.0.1:8079 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard-1.8.0.jar &

二、访问ip:8079 默认用户名密码 sentinel\\sentinel
#yyds干货盘点#安装悟空CRM11

文章图片

十、打包项目
一、下载
https://gitee.com/wukongcrm/crm_pro.git
二、配置
[root@localhost ruanjian]# undip wukongcrm-crm11_pro-master.zip [root@localhost ruanjian]# mv crm_pro/ /data/crm [root@localhost ruanjian]# cd /data/crm/DB#导入数据 mysql> use nacos.sql; mysql -u root -p123456 nacos < seata.sql mysql> use seata; mysql -u root -p123456 seata < seata.sql mysql> use wk_crm_single; mysql> source /data/crm/DB/wk_crm_single.sql mysql> use xxl_job; mysql> source /data/crm/DB/xxl_job.sql; #将mvn命令移动 [root@localhost bin]# cp mvn /usr/local/bin/#在项目根目录执行 mvn install [root@localhost crm]# mvn install #在各个模块下resource目录配置数据库账号信息,以及redis账号信息(默认使用的是application-dev.yml文件),打包后启动脚本默认使用的app-lication-test.yml配置文件. [root@localhost crm]# find ./ -name application-test.yml | grep res ./admin/src/main/resources/application-test.yml ./authorization/src/main/resources/application-test.yml ./bi/src/main/resources/application-test.yml ./crm/src/main/resources/application-test.yml ./examine/src/main/resources/application-test.yml ./job/src/main/resources/application-test.yml ./oa/src/main/resources/application-test.yml ./work/src/main/resources/application-test.yml ./gateway/src/main/resources/application-dev.yml#替换内容 %s/192.168.100.5/127.0.0.1/g#在文件中修改elasticsearch配置,无密码可留空 [root@localhost crm]# vim ./crm/src/main/resources/application-dev.yml elasticsearch: rest: uris: 127.0.0.1:9200 username: password: #项目日志文件在logback-spring.xml文件中可修改,此处不做修改 [root@localhost crm]# vim ./core/src/main/resources/logback-spring.xml #项目再打包部署 [root@localhost crm]# mvn clean -Dmaven.test.skip=true package #创建文件对目录 [root@localhost crm]# mkdir wk_admin [root@localhost crm]# mkdir wk_authorization [root@localhost crm]# mkdir wk_bi [root@localhost crm]# mkdir wk_crm [root@localhost crm]# mkdir wk_gateway [root@localhost crm]# mkdir wk_job [root@localhost crm]# mkdir wk_oa [root@localhost crm]# mkdir wk_work#然后把各个对应模块下target文件夹下的文件上传到服务器,并解压再各自目录中 cp ./admin/target/admin.tar.gz /data/crm_pro/wk_admin/ cp ./authorization/target/authorization.tar.gz /data/crm_pro/wk_authorization/ cp ./bi/target/bi.tar.gz /data/crm_pro/wk_bi/ cp ./crm/target/crm.tar.gz /data/crm_pro/wk_crm/ cp ./gateway/target/gateway.tar.gz /data/crm_pro/wk_gateway/ cp ./job/target/job.tar.gz /data/crm_pro/wk_job/ cp ./oa/target/oa.tar.gz /data/crm_pro/wk_oa/ cp ./work/target/work.tar.gz /data/crm_pro/wk_work/#启动文件,在/data/crm中运行即可,需先启动前面部署的基础服务export DIR=/data/crm_pro/ cd $DIRwk_authorization/ & & ./72crm.sh start cd $DIRwk_admin/ & & ./72crm.sh start & & cd .. cd $DIRwk_bi/ & & ./72crm.sh start & & cd .. cd $DIRwk_crm/ & & ./72crm.sh start & & cd .. cd $DIRwk_gateway/ & & ./72crm.sh start & & cd .. cd $DIRwk_job/ & & ./72crm.sh start & & cd .. cd $DIRwk_oa/ & & ./72crm.sh start & & cd .. cd $DIRwk_work/ & & ./72crm.sh start & & cd ..


    推荐阅读