localhost

How to run ansible plays for some tasks on host when playbook is run via Vagrant provisioner?

谁都会走 提交于 2020-01-05 03:36:39
问题 I am using a Ubuntu 16.04 host with Vagrant installed on it. I would like to log the start time and end time of a set of tasks. These tasks are defined as roles. I created a role host_test role to ensure that I am able to touch a file on my host using local_action . But I believe as this playbook is being provisioned via Vagrant, by the time host_test role is played by ansible, Its control is inside the vagrant box rather than outside of it (my intention is to log in the host). So the file is

Elasticsearch6.x indices apis(索引api)

这一生的挚爱 提交于 2020-01-05 02:52:55
1.索引api indices apis 用于管理索引划分,索引设置,索引别名,字段映射,索引模板 index management 1.1 create index 创建索引,可以指定设置和字段映射,也可以不指定,甚至可以省略创建索引过程,es会自动创建,示例: curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d' { "settings" : { "number_of_shards" : 1 }, "mappings" : { "type1" : { "properties" : { "field1" : { "type" : "text" } } } } } ' 1.2 delete index 指定索引名,或者通配符来删除索引,不能使用别名,使用*或_all会删除所有索引。示例: curl -X DELETE "localhost:9200/twitter" 1.3 get index 获取索引的信息,示例: curl -X GET "localhost:9200/twitter" 1.4 indices exists 检查索引或者别名是否存在,示例: curl -X HEAD "localhost:9200/twitter" 1.5 open/close index api

Elasticsearch6.x索引api

纵然是瞬间 提交于 2020-01-05 02:52:36
1.索引API 索引API在特定索引中添加或更新类型化的JSON文档,使其可搜索。 以下示例在类型名为 _doc, id为1 的类型下将JSON文档插入“twitter”索引 : curl -X PUT "localhost:9200/twitter/_doc/1" -H 'Content-Type: application/json' -d' { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" } ' 上述索引操作的结果是: { "_shards" : { "total" : 2, "failed" : 0, "successful" : 2 }, "_index" : "twitter", "_type" : "_doc", "_id" : "1", "_version" : 1, "_seq_no" : 0, "_primary_term" : 1, "result" : "created" } _shards 头提供关于索引操作的复制过程的信息: total 指示应在其上执行索引操作的分片副本(主分片和副本分片)的数量。 successful 指示索引操作成功的分片副本数。 failed

Unable to test facebook like button on localhost (unlike before)

房东的猫 提交于 2020-01-04 11:44:07
问题 I had developed one small webpage with facebook social plugins (like, recommend and send buttons). I could test the buttons and the click events successfully on localhost till around a month ago; but suddenly the buttons are not working on localhost now. They work only if I deploy the webpage on a public IP through "localtunnel". On localhost, they show the number of likes and names, but don't give a flyout on clicking the button. Also, the subscribed event "edge.create" is not fired. I have

Apachectl “service already loaded” when it's not

蓝咒 提交于 2020-01-04 05:32:09
问题 I am trying to learn a bit about the terminal and servers. I am following a course and in this course it states that you can start and stop the server apache (on mac) by using the command: sudo apachectl start But, when I do this, it comes back with a message saying that apache is already functioning. The full message: /System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded Apache is clearly not running though: ps aux | grep httpd doesn't return any activity. I expect

PHP内置的WEB服务器

二次信任 提交于 2020-01-04 00:42:51
在打开一个新的Lareval57项目的时候,发现在根目录下有一个server.php文件, <?php /** * Laravel - A PHP Framework For Web Artisans * * @package Laravel * @author Taylor Otwell <taylor@laravel.com> */ $uri = urldecode ( parse_url ( $_SERVER [ 'REQUEST_URI' ] , PHP_URL_PATH ) ) ; // This file allows us to emulate Apache's "mod_rewrite" functionality from the // built-in PHP web server. This provides a convenient way to test a Laravel // application without having installed a "real" web server software here. if ( $uri !== '/' && file_exists ( __DIR__ . '/public' . $uri ) ) { return false ; } require_once __DIR__ . '/public

linux中安装配置vnc

别等时光非礼了梦想. 提交于 2020-01-03 21:28:32
要求在图形化界面的虚拟机 安装实验环境 [root@localhost ~]# yum install -y vnc-server vnc vim 启动VNCSERVER [root@localhost ~]# vncserver :1 You will require a password to access your desktops. Password:自己设置的密码 Verify:和上述一样就行 New 'localhost:1 (zx)' desktop is localhost:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost:1.log 配置VNC [root@localhost ~]# vim /etc/sysconfig/vncservers VNCSERVERS="2:hubery" VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost" 在远程Windows机器安装VNC Viewer软件并打开 来源: CSDN 作者: ni gei wo

前后端分离crud

那年仲夏 提交于 2020-01-03 19:13:42
跨域 跨域 就是跨域名来访问的数据 跨域原因说明 示例 域名不同 www.jd.com 与 www.taobao.com 域名相同,端口不同 www.jd.com:8080 与 www.jd.com:8081 二级域名不同 item.jd.com 与 miaosha.jd.com www.baidu.wenku.com www.baid.tieba.com 如果域名和端口都相同,但是请求路径不同,不属于跨域,如: www.jd.com/item www.jd.com/goods 只要域名(ip)和端口号有一样不同,那么都是跨域 http://localhost:8080 前端系统 发送Ajax取后端系统获取数据 http://localhost:80 后端系统 跨域问题 跨域问题: 浏览器 针对ajax请求的时候,如果不同的服务,存在跨域 浏览器机制: 同源策略拦截跨域的访问 跨域不一定会有跨域问题。 解决跨域问题 (1) jsonp方式 --json变种 最早的解决方案,利用动态去填充script标签可以跨域的原理实现 localhost/department/list -- > <scprit src="/localhost/department/list"> 缺点: 需要服务支持 只能发起GET 请求 (2) nginx 反向代理 利用nginx反向代理把跨域为不跨域

Prometheus 监控部署安装

心不动则不痛 提交于 2020-01-03 12:04:09
prometheus 介绍 Prometheus是一个开源的系统监控和报警工具包,普罗米修斯在2016年加入了云原生计算基金会,成为继Kubernetes之后的第二个项目。 普罗米修斯的主要特征是: 多维数据模型,时间序列数据由度量名称和键/值对标识 PromQL是一种灵活的查询语言,可以利用这种维度 不依赖分布式存储;单个服务器节点是自治的 时间序列收集通过HTTP上的拉模型进行 通过中间网关支持时间序列的推送 通过服务发现或静态配置发现目标 多种模式的绘图和仪表板的支持 架构图 组件 prometheus server 端 负责定时在目标上抓取metrics(指标)数据,每个抓取目标都需要暴露一个http 服务接口用于 prometheus 定时抓取,这种调用监控对象获取监控数据的方式称为pull prometheus client 端 为需要监控的服务生成相应的 metrics 并暴露给 Prometheus server Push Gateway:主要用于短期的 jobs。由于这类 jobs 存在时间较短,可能在 Prometheus 来 pull 之前就消失了。为此,这次 jobs 可以直接向 Prometheus server 端推送它们的 metrics。这种方式主要用于服务层面的 metrics,对于机器层面的 metrices,需要使用 node exporter

127.0.0.1 Will not work in IE 11

折月煮酒 提交于 2020-01-03 08:07:17
问题 I have upgraded to Windows 8.1 pro and 127.0.0.1 and my local IP will not resolve to to the IIS 8.5 start page but localhost will. But it all works in Firefox and Chrome. I have no idea how to fix this it shows no errors other than this: This page can’t be displayed Make sure the web address 127.0.0.1 is correct. Look for the page with your search engine. Refresh the page in a few minutes. Could some one help me figure this out? Never mind I got it working I figured it out had to turn off new