首页 文章 精选 留言 我的

精选列表

搜索[基础搭建],共10000篇文章
优秀的个人博客,低调大师

【Elasticsearch全文搜索引擎实战】之集群搭建及配置

文中Elasticsearch版本为6.0.1 1. 环境配置 把环境配置放在第一节来讲,是因为很多人按官网的Getting Started安装运行会有各种错误。其实都是因为一些配置不正确引起的。 首先,Elasticsearch不能以root账号运行,所以我们需要单独建立用户授权运行。 对于非root账号Linux可以进行并发操作,但是文件、线程都有限制,所以,部署Elasticsearc的机器需要进行相应配置。 修改文件限制 # 修改系统文件 vi /etc/security/limits.conf # 增加的内容 * soft nofile 65536 * hard nofile 65536 * soft nproc 2048 * hard nproc 4096 调整进程数 # 修改系统文件 vi /etc/security/limits.d/90-nproc.conf # 调整成以下配置 * soft nproc 4096 root soft nproc unlimited 调整虚拟内存&最大并发连接 # 修改系统文件 vi /etc/sysctl.conf # 增加的内容 vm.max_map_count=655360 fs.file-max=655360 保存之后执行 sysctl -p 生效 创建Elasticsearch专用用户 useradd es 创建ELK相关目录并赋权 #创建Elasticsearch APP目录 mkdir /usr/elasticsearch #创建Elasticsearch日志目录 数据目录 mkdir var/lib/elasticsearch #创建Elasticsearch日志目录 mkdir var/logs/elasticsearch #更改目录Owner chown -R es:es /usr/elasticsearch chown -R es:es var/lib/elasticsearch chown -R es:es var/logs/elasticsearch 下载Elasticsearch包并解压 https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-targz.html #打开文件夹 cd /home/download #下载 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.1.tar.gz #解压 tar -zvxf elasticsearch-6.0.0.tar.gz 2. Elasticsearch 部署 本次一共要部署两个Elasticsearch节点,所有文中没有指定机器的操作都表示每个Elasticsearch机器都要执行该操作 移动Elasticsearch到统一目录 #移动目录 mv /home/download/elasticsearch-6.0.1 /usr/elasticsearch #赋权 chown -R elk:elk /usr/elasticsearch/ 开放端口(CentOS7+) # 增加端口 firewall-cmd --add-port=9200/tcp --permanent firewall-cmd --add-port=9300/tcp --permanent 重新加载防火墙规则(CentOS7+) firewall-cmd --reload 切换账号 #账号切换到 es su - es 2. Elasticsearch集群配置 修改配置 #打开目录 cd /usr/elasticsearch #修改配置 vi config/elasticsearch.yml 主节点配置(192.168.180.1) cluster.name: es node.name: node-1 path.data: /var/lib/elasticsearch path.logs: /var/logs/elasticsearch network.host: 192.168.180.1 http.port: 9200 node.master: true node.data: true discovery.zen.ping.unicast.hosts: ["192.168.180.1:9300","192.168.180.2:9300"] discovery.zen.minimum_master_nodes: 2 从节点配置(192.168.180.2) cluster.name: es node.name: node-2 path.data: /var/lib/elasticsearch path.logs: /var/logs/elasticsearch network.host: 192.168.180.2 http.port: 9200 node.master: false node.data: true discovery.zen.ping.unicast.hosts: ["192.168.1.31:9300","192.168.1.32:9300"] discovery.zen.minimum_master_nodes: 2 配置参数说明 参数 说明 cluster.name 集群名 node.name 节点名 path.data 数据保存目录 path.logs 日志保存目录 network.host 节点host/ip http.port HTTP访问端口 node.master 是否允许作为主节点 node.data 是否保存数据 discovery.zen.ping.unicast.hosts 集群中的主节点的初始列表,当节点(主节点或者数据节点)启动时使用这个列表进行探测 discovery.zen.minimum_master_nodes master选举最少的节点数,这个一定要设置为N/2+1,其中N是:N是具有master资格的节点的数量,而不是整个集群节点个数 3. 启动Elasticsearch 运行 #进入elasticsearch根目录 cd /usr/elasticsearch #启动 (-d 为后台运行) ./bin/elasticsearch -d 验证 访问http://192.168.180.1:9200/,可以看到如下内容则表示成功: { name: "node-1", cluster_name: "es", cluster_uuid: "Tum8l98uQfK0LdS-KnsWxg", version: { number: "6.0.1", build_hash: "601be4a", build_date: "2017-12-04T09:29:09.525Z", build_snapshot: false, lucene_version: "7.0.1", minimum_wire_compatibility_version: "5.6.0", minimum_index_compatibility_version: "5.0.0" }, tagline: "You Know, for Search" } 健康状态检查 访问http://192.168.180.1:9200/,status返回green则表示正常。 { cluster_name: "es", status: "green", timed_out: false, number_of_nodes: 2, number_of_data_nodes: 2, active_primary_shards: 16, active_shards: 32, relocating_shards: 0, initializing_shards: 0, unassigned_shards: 0, delayed_unassigned_shards: 0, number_of_pending_tasks: 0, number_of_in_flight_fetch: 0, task_max_waiting_in_queue_millis: 0, active_shards_percent_as_number: 100 } 4. Head插件 Elasticsearch head是一个用浏览器跟ES集群交互的插件,可以查看集群状态、集群的doc内容、执行搜索和普通的Rest请求等。 具体安装配置请参考另外一篇博文:http://www.cnblogs.com/mantoudev/p/8269345.html

优秀的个人博客,低调大师

docker学习笔记(二)——本地私有仓库Registry的搭建与验证

Registry的部署 获取registry镜像 1 #dockerpullregistry:2.1.1 启动registry容器 1 2 3 4 5 6 7 8 9 #dockerrun-d-v/opt/registry:/var/lib/registry-p5000:5000--restart=always--nameregistryregistry:2.1.1 查看进程 #dockerps CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES ac291ed888feregistry:2.1.1 "/bin/registry/et..." 27minutesagoUp27minutes0.0.0.0:5000->5000 /tcp registry 验证服务是否正常 #curlhttp://127.0.0.1:5000/v2/ {} 上传镜像 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 查看本地已有镜像 #dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE nginxv2570d531c994a4hoursago107MB nginxlatestb8efb18f159b3weeksago107MB centos6.80cd976dc0a9811monthsago195MB registry2.1.152bb991b482e22monthsago220MB 创建dockertag镜像 #dockertagnginx:v2127.0.0.1:5000/nginx:v2 即用ningx:v2创建127.0.0.1:5000 /nginx :v2的镜像 #dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE 127.0.0.1:5000 /nginx v2570d531c994a4hoursago107MB nginxv2570d531c994a4hoursago107MB nginxlatestb8efb18f159b3weeksago107MB centos6.80cd976dc0a9811monthsago195MB registry2.1.152bb991b482e22monthsago220MB push镜像到本地仓库 #dockerpush127.0.0.1:5000/nginx:v2 Thepushreferstoarepository[127.0.0.1:5000 /nginx ] 04a8761254c7:Pushed af5bd3938f60:Pushed 29f11c413898:Pushed eb78099fbf7f:Pushed v2:digest:sha256:9586184eb142f8c66decfd4fd7b3a2b54abfcb0f0a25541e69ba3725c61ba8b3size:8522 查看是否已经上传 #curlhttp://192.168.12.109:5000/v2/_catalog { "repositories" :[ "nginx" ]} 下载镜像 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 先删除已经有的镜像 [root@DockServeropt] #dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE 127.0.0.1:5000 /nginx v2570d531c994a4hoursago107MB nginxv2570d531c994a4hoursago107MB nginxlatestb8efb18f159b3weeksago107MB centos6.80cd976dc0a9811monthsago195MB registry2.1.152bb991b482e22monthsago220MB [root@DockServeropt] #dockerrmi-f570d531c994a Untagged:127.0.0.1:5000 /nginx :v2 Untagged:127.0.0.1:5000 /nginx @sha256:9586184eb142f8c66decfd4fd7b3a2b54abfcb0f0a25541e69ba3725c61ba8b3 Untagged:nginx:v2 Deleted:sha256:570d531c994a495b7cba536ac12f9d640141cbbaecd9ae8a114816681a8ca750 Deleted:sha256:f4a3f9102faadf3e941a05724ffe69e3aa3dc1fee5de3762c374ee337a27d60b [root@DockServeropt] #dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE nginxlatestb8efb18f159b3weeksago107MB centos6.80cd976dc0a9811monthsago195MB registry2.1.152bb991b482e22monthsago220MB 确定已经删除后,我们下载 [root@DockServeropt] #dockerpull127.0.0.1:5000/nginx:v2 v2:Pullingfromnginx 94ed0c431eb5:Alreadyexists 9406c100a1c3:Alreadyexists aa74daafd50c:Alreadyexists 79afb5d63c06:Pullcomplete Digest:sha256:9586184eb142f8c66decfd4fd7b3a2b54abfcb0f0a25541e69ba3725c61ba8b3 Status:Downloadednewerimage for 127.0.0.1:5000 /nginx :v2 [root@DockServeropt] #dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE 127.0.0.1:5000 /nginx v2d296335af0a94hoursago107MB nginxlatestb8efb18f159b3weeksago107MB centos6.80cd976dc0a9811monthsago195MB registry2.1.152bb991b482e22monthsago220MB 可以看到已经本地仓库 可以成功上传 下载镜像了 本文转自 jackjiaxiong 51CTO博客,原文链接:http://blog.51cto.com/xiangcun168/1957392

优秀的个人博客,低调大师

阿里云服务器怎么搭建sql server(即 MS SQL)?

注意,请先到阿里云官网 领取幸运券,除了价格上有很多优惠外,还可以参与抽奖。详见:https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=2a7uv47d&utm_source=2a7uv47d 步骤1、配置远程桌面连接 首先确定自己的公网ip地址,这个在构建云服务器实例时,每一个实例会分配一个公网地址,一个内网地址。 然后, 开始-->运行 ,输入mstsc.exe,确定 将第一步确定的公网地址输入,点开选项 常规-->计算机中填入公网地址,用户名填入administrator。 显示可选择合适的远程桌面大小,如果不做本机操作,可以选全屏 本地资源中勾选“剪贴板”方便操作中本机与远程编辑,点详细信息 在“驱动器”中勾选本机的某驱动器,以便本机与服务器传输文件 全部设置完后,点连接 在点连接 出现要求密码的对话框时输入密码,即可进入远程桌面。 此时远程桌面配置完毕。 打开远程桌面上的计算机,会看到本机的驱动器,这样就可以将本机上需要传送的文件复制到服务器了,将来开发的程序也可上传过去。 END 步骤2、安装sqlserver2005Express 百度一个sqlserver2005Express,下载后上传到云服务器里,这是32位的。 如果出现如下对话框,选“运行程序”。 接受许可 点安装 下一步 姓名、公司随便填,“隐藏高级配置选项”前的勾去掉,以便后边进行自定义配置,初学者可以使用默认配置 客户端组件中连接组件要选,软件开发包根据需要自定 命名实例可以自定义,将来安装好后,在管理工具-->服务中可以看到这个服务名 选用“使用内置系统帐户”和“网络服务”,勾选“安装结束时启动服务”下的“SQL Server”和“SQL Brower”,这个也可以在安装后在管理工具-->服务中设置相应服务是否开机自动启动。 身份验证模式最好选“混合模式”,便于网络存取。如果用“混合模式”,则要设置sa的密码,sa是数据库的超级管理员的用户名。 继续下一步 接下来全是下一步,直到安装完毕 步骤3、查询刚才新建的实例 安装完成后,在管理工具-->服务中,找到自己刚才安装的实例。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册