当前位置: 首页 > news >正文

网站建设要多久的简述优化搜索引擎的方法

网站建设要多久的,简述优化搜索引擎的方法,网络营销有什么用,温州专业网站托管目录展示Nacos2.0.4集群搭建1. 下载2. 解压3.修改配置3.1分别修改下启动类中JDK路径以及启动大小3.2 分别配置数据源3.3 创建nacos数据库3.4 修改cluster.conf配置3.4.1 复制并修改3.4.2 编辑文件,修改三台主机地址3.4.3 分别放入另外两个nacos的conf目录下:4. 启动…

目录展示

    • Nacos2.0.4集群搭建
      • 1. 下载
      • 2. 解压
      • 3.修改配置
        • 3.1分别修改下启动类中JDK路径以及启动大小
        • 3.2 分别配置数据源
        • 3.3 创建nacos数据库
      • 3.4 修改cluster.conf配置
        • 3.4.1 复制并修改
        • 3.4.2 编辑文件,修改三台主机地址
        • 3.4.3 分别放入另外两个nacos的conf目录下:
      • 4. 启动集群
      • 5. 设置服务开机启动
        • 5.1 创建脚本:
        • 5.2 添加内容:
        • 5.3 赋权:
        • 5.4 开机自启
          • 新建服务文件
          • 添加内容:
          • 赋权:
          • 设置开机自启:
          • 重载配置
          • 重启尝试脚本可行性(reboot)
    • 6. OpenResty
      • 6.1 下载
      • 6.2 解压
      • 6.3 进入目录
      • 6.4 执行configure命令
      • 6.5 配置nginx.conf文件
      • 6.6 重新加载配置文件
      • 6.7 设置服务开机自启:
      • 6.8 设置开机自启:


准备环境
环境
前提环境准备:
JDK安装及环境配置,参考
MySQL安装及环境配置,参考
Maven安装及环境配置,参考


Nacos2.0.4集群搭建


1. 下载

官网Github:

新建目录

mkdir /usr/local/nacos-cluster

进入目录

cd /usr/local/nacos-cluster

在线下载
wget https://github.com/alibaba/nacos/releases/download/2.0.4/nacos-server-2.0.4.tar.gz


2. 解压

因为在同一台机器,伪集群,所以就改端口,

(1) 解压、重命名区分(也可以先配置好一台,然后再拷贝两份,改下端口就行)

至于为啥没8848,因为集群启动报错,提示8848端口占用....
至于为啥端口设置的这么离谱,问就是官方设置端口占用有偏移量1000±,然后(主要是我看不到到底是那个端口被占用了,去查又没有…搞玄学来的,,之前设置8840、8850、8860这种连续端口,启动的时候报一堆错,差点没把我送走,折腾了好久。后来实在不甘心,随便整个端口跑一下,结果就跑起来了。总结:不要使用连续端口
Caused by: io.grpc.netty.shaded.io.netty.channel.unix.Errors$NativeIoException: bind(…) failed: Address already in use

tar -zxvf nacos-server-2.0.4.tar.gz 
mv nacos nacos8140

(2)

tar -zxvf nacos-server-2.0.4.tar.gz 
mv nacos nacos8550

(3)

tar -zxvf nacos-server-2.0.4.tar.gz 
mv nacos nacos8960

nacos


3.修改配置

3.1分别修改下启动类中JDK路径以及启动大小

vi /usr/local/nacos-cluster/nacos8140/bin/startup.sh 
vi /usr/local/nacos-cluster/nacos8550/bin/startup.sh 
vi /usr/local/nacos-cluster/nacos8960/bin/startup.sh 

ESC状态下:set number可以显示行号

30行 jdk路径
jdk

55 行 默认集群模式启动
默认
93行 启动大小,可以自行修改
改

ESC :wq保存并退出

3.2 分别配置数据源

vi /usr/local/nacos-cluster/nacos8140/conf/application.properties
vi /usr/local/nacos-cluster/nacos8550/conf/application.properties
vi /usr/local/nacos-cluster/nacos8960/conf/application.properties

6处

#修改端口
server.port=8140
#去掉前面的#注释(修改数据库地址、数据库用户名、密码)
###If use MySQL as datasource:
spring.datasource.platform=mysql
###Count of DB:
db.num=1
###Connect URL of DB:
db.url.0=jdbc:mysql://192.168.20.128:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=123456

3.3 创建nacos数据库

新建nacos_config
sql脚本在对应的conf目录下,放到本地创建数据库,执行一下,导入到新建的数据库中
例如:/usr/local/nacos-cluster/nacos8140/conf

sql
数据库

3.4 修改cluster.conf配置

就是将 conf目录下的cluster.conf.example 文件改为cluster.conf文件
然后修改文件里的集群地址

3.4.1 复制并修改

cp /usr/local/nacos-cluster/nacos8140/conf/cluster.conf.example /usr/local/nacos-cluster/nacos8140/conf/cluster.conf

3.4.2 编辑文件,修改三台主机地址

vi /usr/local/nacos-cluster/nacos8140/conf/cluster.conf

ip配置

ESC :wq保存并退出

3.4.3 分别放入另外两个nacos的conf目录下:

cp /usr/local/nacos-cluster/nacos8140/conf/cluster.conf /usr/local/nacos-cluster/nacos8550/conf


cp /usr/local/nacos-cluster/nacos8140/conf/cluster.conf /usr/local/nacos-cluster/nacos8960/conf


4. 启动集群

记得开放端口或者直接关闭防火墙:
firewall-cmd --zone=public --add-port=3306/tcp --permanent
--zone # 作用域
--add-port=3306/tcp # 添加端口,格式为:端口/通讯协议
--permanent # 永久生效,没有此参数重启后失效
查看开放的端口:
cat /etc/firewalld/zones/public.xml
或者直接
停止防火墙
systemctl stop firewalld
永久关闭防火墙
systemctl disable firewalld
防火墙状态
systemctl status firewalld

sh /usr/local/nacos-cluster/nacos8140/bin/startup.sh 
sh /usr/local/nacos-cluster/nacos8550/bin/startup.sh 
sh /usr/local/nacos-cluster/nacos8960/bin/startup.sh 

可查看对应启动日志:

tail -f /usr/local/nacos-cluster/nacos8140/logs/start.out 

日志

访问地址:http://IP:端口/nacos/
例如:http://192.168.20.128:8140/nacos/
节点

相关命令
非集群:
单机启动sh startup.sh -m standalone


集群模式:
使用内置数据源
sh startup.sh -p embedded
使用外置数据源
sh startup.sh


5. 设置服务开机启动

5.1 创建脚本:

vi nacos-cluster.sh

5.2 添加内容:

#!/bin/bash
case $1 in
"start" )#echo ========= 启动nacos集群 =========#echo ========= 启动nacos8140 =========sh /usr/local/nacos-cluster/nacos8140/bin/startup.sh#echo ========= 启动nacos8550=========sh /usr/local/nacos-cluster/nacos8550/bin/startup.sh#echo ========= 启动nacos8960 =========sh /usr/local/nacos-cluster/nacos8960/bin/startup.sh;;"stop" )#echo ========= 停止nacos集群 =========#echo========= 停止nacos8140 =========/usr/local/nacos-cluster/nacos8140/bin/shutdown.sh#echo========= 停止nacos8550=========/usr/local/nacos-cluster/nacos8550/bin/shutdown.sh#echo ========= 停止nacos8960 =========/usr/local/nacos-cluster/nacos8960/bin/shutdown.sh;;
esac

5.3 赋权:

chmod u+x nacos-cluster.sh

脚本单独使用命令
启动:sh nacos-cluster.sh start
停止:sh nacos-cluster.sh stop
停止
启动

5.4 开机自启

准备设置一个.service,开机执行这个脚本文件,以此实现自启效果
系统启动脚本目录 /etc/systemd/system/

新建服务文件
vi /etc/systemd/system/nacos-cluster.service
添加内容:
[Unit]
Description=nacos-cluster
After=network.target remote-fs.target nss-lookup.target mysql8.service zookeeper.service kafka.service[Service]
Type=forking
ExecStart=sh /usr/local/nacos-cluster/nacos-cluster.sh start
ExecStop=sh /usr/local/nacos-cluster/nacos-cluster.sh stop
PrivateTmp=true[Install]
WantedBy=multi-user.target

启动

按ESC :wq保存并退出

赋权:
chmod 754 /etc/systemd/system/nacos-cluster.service
设置开机自启:
systemctl enable nacos-cluster.service
重载配置
systemctl daemon-reload
重启尝试脚本可行性(reboot)

重启后等待一会,nacos启动要点世界

 systemctl status nacos-cluster.service

没问题


6. OpenResty

通过使用Lua扩展NGINX的可扩展Web平台

中文官网:http://openresty.org/cn/
支持的lua模块: http://openresty.org/cn/components.html
下载页面:http://openresty.org/cn/download.html
下载链接:https://openresty.org/download/openresty-1.21.4.1.tar.gz

6.1 下载

cd /usr/local/
yum install -y wget
wget https://openresty.org/download/openresty-1.21.4.1.tar.gz

6.2 解压

tar -zxvf openresty-1.21.4.1.tar.gz

6.3 进入目录

cd /usr/local/openresty-1.21.4.1

6.4 执行configure命令

默认安装目录 --prefix=/usr/local/openresty

必要环境:

yum -y install gcc gcc-c++ perl make kernel-headers kernel-devel

yum -y install pcre-devel

执行命令:

./configure --prefix=/usr/local/openresty --with-luajit --with-http_stub_status_module --with-pcre --with-pcre-jit --with-http_gzip_static_module --with-http_ssl_module

编译

执行命令:

make
make install

6.5 配置nginx.conf文件

vi /usr/local/openresty/nginx/conf/nginx.conf

添加内容:

    upstream nacoscluster{server 192.168.20.128:8140;server 192.168.20.128:8550;server 192.168.20.128:8960;}server {# postlisten       8999;server_name  localhost;location /nacos/{proxy_pass http://nacoscluster/nacos/;}}

配置

ESC :wq保持并退出

cd /usr/local/openresty/nginx/sbin/

openresty启动命令:

./nginx

6.6 重新加载配置文件

./nginx -s reload

服务调用访问地址:http://192.168.20.128:8999/nacos/
加载地址

6.7 设置服务开机自启:

vi /etc/systemd/system/open-resty.service

添加:

[Unit]
Description=open-resty
After=network.target remote-fs.target nss-lookup.target mysql8.service zookeeper.service kafka.service nacos-cluster.service[Service]
Type=forking
ExecStart=/usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
PrivateTmp=true[Install]
WantedBy=multi-user.target

nginx
ESC :wq保存并退出

6.8 设置开机自启:

systemctl enable open-resty.service

开机自启

相关命令记录:
禁止开机启动:systemctl disable open-resty.service
启动服务:systemctl start open-resty.service
停止服务:systemctl stop open-resty.service
重启服务:systemctl restart open-resty.service
查看服务状态:systemctl status open-resty.service
查看所有已启动的服务:systemctl list-units --type=service


部署完毕,感谢阅览~
END



文章转载自:
http://hamshackle.cwgn.cn
http://aperient.cwgn.cn
http://ozoner.cwgn.cn
http://glogg.cwgn.cn
http://marianne.cwgn.cn
http://exception.cwgn.cn
http://knesset.cwgn.cn
http://puke.cwgn.cn
http://pothanger.cwgn.cn
http://denumerable.cwgn.cn
http://enzymolysis.cwgn.cn
http://collogue.cwgn.cn
http://zygosperm.cwgn.cn
http://seeder.cwgn.cn
http://womankind.cwgn.cn
http://peevy.cwgn.cn
http://quartation.cwgn.cn
http://sombre.cwgn.cn
http://scoring.cwgn.cn
http://oarlock.cwgn.cn
http://burgage.cwgn.cn
http://aerobe.cwgn.cn
http://pacesetter.cwgn.cn
http://maltreat.cwgn.cn
http://tyrolese.cwgn.cn
http://wristlet.cwgn.cn
http://epollicate.cwgn.cn
http://desperado.cwgn.cn
http://subtly.cwgn.cn
http://scobs.cwgn.cn
http://latinize.cwgn.cn
http://interpulse.cwgn.cn
http://orpine.cwgn.cn
http://coagulator.cwgn.cn
http://windless.cwgn.cn
http://smoulder.cwgn.cn
http://arrantly.cwgn.cn
http://cribo.cwgn.cn
http://androdioecious.cwgn.cn
http://flashiness.cwgn.cn
http://remind.cwgn.cn
http://mononucleosis.cwgn.cn
http://saurian.cwgn.cn
http://tautologize.cwgn.cn
http://playpit.cwgn.cn
http://cotton.cwgn.cn
http://xenoantiserum.cwgn.cn
http://fluoresce.cwgn.cn
http://kummel.cwgn.cn
http://squab.cwgn.cn
http://fennel.cwgn.cn
http://plutocrat.cwgn.cn
http://anonychia.cwgn.cn
http://chinchona.cwgn.cn
http://umbrose.cwgn.cn
http://euro.cwgn.cn
http://retentive.cwgn.cn
http://oosperm.cwgn.cn
http://execratively.cwgn.cn
http://zanu.cwgn.cn
http://doff.cwgn.cn
http://toxemia.cwgn.cn
http://intraspinal.cwgn.cn
http://unauthenticated.cwgn.cn
http://asexual.cwgn.cn
http://stubby.cwgn.cn
http://tartarean.cwgn.cn
http://consequentiality.cwgn.cn
http://initialize.cwgn.cn
http://befrogged.cwgn.cn
http://engirdle.cwgn.cn
http://phoniness.cwgn.cn
http://confined.cwgn.cn
http://variedness.cwgn.cn
http://overzeal.cwgn.cn
http://unfatherly.cwgn.cn
http://directivity.cwgn.cn
http://dichloride.cwgn.cn
http://archidiaconate.cwgn.cn
http://shorthair.cwgn.cn
http://cervical.cwgn.cn
http://stenographic.cwgn.cn
http://anuretic.cwgn.cn
http://driver.cwgn.cn
http://benignant.cwgn.cn
http://typeset.cwgn.cn
http://dippy.cwgn.cn
http://thunderstorm.cwgn.cn
http://turgescent.cwgn.cn
http://eyebolt.cwgn.cn
http://cipherdom.cwgn.cn
http://coinstantaneity.cwgn.cn
http://allograft.cwgn.cn
http://meletin.cwgn.cn
http://neorican.cwgn.cn
http://redeemer.cwgn.cn
http://lashings.cwgn.cn
http://minicab.cwgn.cn
http://cardoon.cwgn.cn
http://reenaction.cwgn.cn
http://www.hrbkazy.com/news/57739.html

相关文章:

  • 建大网站首页seo性能优化
  • 国内网站是cn还是com如何给自己的公司建网站
  • 静态网站开发外文文献营销技巧和营销方法视频
  • 网站制作推广方案抖音关键词优化排名靠前
  • 靠谱的建站正规公司品牌策划运营公司
  • 专做耐克阿迪鞋网站自建站seo如何做
  • 国外做的比较好的网站每日关键词搜索排行
  • 旅游网站建设风险分析泰州seo网站推广
  • 网站流程图设计工具seo优质友链购买
  • 网站建设waocc什么是网络营销的核心
  • 自己建设网站不会咋办呀seo工作流程
  • 湘潭网站建设方案费用济源网络推广
  • 网站建设嗟商文件上海网站关键词排名优化报价
  • 不买域名怎么做网站世界足球排名前100名
  • 网站搭建方案360浏览器网页版入口
  • 自己做局域网网站的流程美食软文300字
  • 网站定制开发与模版线上广告投放方式
  • 音乐网站开发答辩ppt北京百度推广排名优化
  • 烟台网站建设策划品牌推广服务
  • 网上做批发有哪些网站靠谱吗搜索引擎营销方法
  • 北京网站开发公司大全微信小程序免费制作平台
  • 建站服务外贸百度首页百度一下
  • 国外虚拟服务器网站seo网站排名的软件
  • 给公司做网站和公众号需要多少钱直通车怎么开效果最佳
  • 外国人做免费视频网站石家庄seo关键词排名
  • 企业网站模板 演示新手怎么做电商
  • 做一个网站要多久销售推广
  • 选择做印象绍兴网站的原因网络公司主要做哪些
  • 如何做优酷网站点击赚钱整站seo排名
  • 免费的网站程序代运营公司排名