localhost

SpringCloud微服务小白入门之Eureka注册中心和服务中心搭建示例

北战南征 提交于 2019-12-27 00:46:25
一、注册中心配置文件 代码复制区域: spring: application: name: spring-cloud-serverserver: port: 7000eureka: instance: hostname: localhost lease-expiration-duration-in-seconds: 10 #租期更新时间间隔(默认30秒) lease-renewal-interval-in-seconds: 30 #租期到期时间(默认90秒) client: registerWithEureka: false fetchRegistry: false serviceUrl: defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ server: enable-self-preservation: false #关闭自我保护机制,保证不可用服务及时踢出 eviction-interval-timer-in-ms: 4000 #清理间隔(单位毫秒,默认是60*1000) 二、在pom.xml里添加注册中心和服务中心依赖 代码复制区域: <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring

MySQL for mac使用记录

 ̄綄美尐妖づ 提交于 2019-12-26 21:18:06
一、登录 打开终端,输入/usr/local/mysql/bin/mysql -u root -p 初次进入mysql,密码为空。当出现mysql>提示符时,表示你已经进入mysql中。键入exit退出mysql。 二、更改Mysqlroot用户密码 更改mysql root 用户密码,在终端输入/usr/local/mysql/bin/mysqladmin -u root password新密码 设置新的密码,再次输入/usr/local/mysql/bin/mysql -u root -p登录: 三、创建用户 以root身份登录mysql: 创建一个用户,键入insert into mysql.user(Host,User,Password) values("localhost","新用户",password("密码")); 刷新系统权限表,键入 flush privileges; 这样就创建了一个用户名为Lands,密码为Lands的用户。尝试用新用户密码登录: 四、删除用户 登录root 账户。 删除用户,键入 DELTE FROM mysql.user WHERE User="用户名"; 刷新权限表,键入 flush privileges; 五、修改指定用户密码 登录root 账户。 修改指定用户密码,键入update mysql.user set password

node express 设置重定向

北城以北 提交于 2019-12-26 20:15:33
var express = require('express'); var app = express(); app.get('/',function(req,res){ res.redirect('/admin'); }); app.get('/admin',function(req,res){ res.send('欢迎管理员'); }); app.listen(3000); 当我们访问: http://localhost:3000/ 时将自动调整到 http://localhost:3000/admin 如果需要详细设置,可通过res.hostname来进行判断: http://localhost 的host为localhost 来源: https://www.cnblogs.com/xulei1992/p/12104130.html

Ubuntu MySQL第一次登陆

江枫思渺然 提交于 2019-12-26 19:34:02
Ubuntu MySQL第一次登陆 初次登陆如果输入mysql -u root -p 可能会出现以下问题: ERROR 1045 (28000): Access denied for user’root’@‘localhost’ (using password: YES) *或者NO 解决方法: - [ ] sudo cat /etc/mysql/ debian.cnf 然后可以看到 [client] host = localhost user = debian-sys-maint password = xqoWA1z679AfgsWU socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = xqoWA1z679AfgsWU socket = /var/run/mysqld/mysqld.sock 直接找到user和password重新登陆就行了 输入密码处直接复制黏贴就行,手敲容易出错 本博客链接为 https://blog.csdn.net/weixin_44794718/article/details/103719932 来源: CSDN 作者: weixin_44794718 链接: https://blog.csdn

安装kafka 集群 步骤

好久不见. 提交于 2019-12-26 17:41:41
1.下载 http://mirror.bit.edu.cn/apache/kafka/2.1.0/kafka_2.11-2.1.0.tgz 2.解压 tar -zxvf kafka_2.11-2.1.0.tgz 3.创建两份配置文件 cd conf cp server.properties server1.properties cp server.properties server2.properties 4.创建两个log目录 cd logs mkdir log1 log2 5.编辑配置文件 编辑 server1.properties,server2.properties 主要修改点 #broker id 在集群中必须唯一 broker.id=1 #监听端口 #listeners=PLAINTEXT://:9001 host.name=192.168.1.1 port=9001 #topic 分区数量 num.partitions=5 # 数据存储目录 log.dirs=/home/kafka/kafka_2.12-2.1.0/logs/log1 # zookpeer 配置 zookeeper.connect=localhost:2181,localhost:2182,localhost:2183 两个文件不同的地方 broker.id,log.dirs ,host.name

Ubuntu下 ssh : connect to host localhost port 22:Connection refused

╄→гoц情女王★ 提交于 2019-12-26 15:20:53
Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因可能是ssh-server未安装或者未启动。ubuntu 11.10 默认安装openssh-client,但是木有安装server 运行 ps -e | grep ssh,查看是否有sshd进程 如果没有,说明server没启动,通过 /etc/init.d/ssh -start 启动server进程,如果提示ssh不存在 那么就是没安装server 通过 sudo apt-get install openssh-server命令安装即可 Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因可能是ssh-server未安装或者未启动。ubuntu 11.10 默认安装openssh-client,但是木有安装server 运行 ps -e | grep ssh,查看是否有sshd进程 如果没有,说明server没启动,通过 /etc/init.d/ssh -start 启动server进程,如果提示ssh不存在 那么就是没安装server

创建与使用Web API

会有一股神秘感。 提交于 2019-12-26 11:00:50
前些天,Insus.NET有演示Web API接口的操作: 《 怎样操作WebAPI接口(显示数据) 》 http://www.cnblogs.com/insus/p/5670401.html 《 ASP.NET MVC对WebAPI接口操作(添加,更新和删除) 》 http://www.cnblogs.com/insus/p/5673641.html 但是,有网友说,不想使用jQuery,全部以ASP.NET MVC来实现。Ok,那来看看,先来实现POST的功能,即是往Web API添加数据。 在控制器中,创建两个Action,即是视图Action,另一个是POST的Action: HttpClient client = new HttpClient(); HttpContent httpcontent = new StringContent(size.ToJson(), System.Text.Encoding.UTF8, "application/json"); client.PostAsync("http://localhost:9001/api/size", httpcontent) .ContinueWith((postTask) => { postTask.Result.EnsureSuccessStatusCode(); }); Source Code 视图代码:

springboot-actuator应用后台监控

时光怂恿深爱的人放手 提交于 2019-12-26 08:30:27
一 前言 springboot 额外的特色是提供了后台应用监控,可以通过 HTTP 或者 JMX的方式管理监控应用,本文主讲HTTP方式;其主要的功能是监控应用的健康状态,查看环境变量等; 二 pom.xml springboot 2.1.1,主要引入 actuator 依赖,web依赖用于测试; <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> 三 默认开启端点 3.1 默认端点 health 直接编写主程序入口,启动;浏览器输入 http://localhost:8080/actuator/health;结果如下,状态是UP; 翻翻源码heath状态码如下 public OrderedHealthAggregator() { this.setStatusOrder(Status.DOWN, Status.OUT_OF_SERVICE,

服务器创建好后怎样使用远程连接工具链接的一些问题

大城市里の小女人 提交于 2019-12-26 05:25:04
报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost 报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1。 改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。 例如,你想myuser使用mypassword从任何主机连接到mysql 服务器 的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 如果你想允许用户myuser从ip为192.168.1

mysql——密码管理——root用户修改普通用户密码

可紊 提交于 2019-12-26 02:05:45
前期准备,建立一个普通用户: create user 'sww'@'localhost' identified by '123456'; /*创建一个用户*/ select * from user; mysql -h localhost -P 3306 -u sww -p123456 /*DOS窗口中登录查看*/ drop user 'sww'@'localhost'; /*删除这个新建的用户*/ select * from user; mysql -h localhost -P 3306 -u sww -p123456 用户名: root 密码:123DOS窗口登录: ======================================================================= 方法一、使用set语句来修改普通用户的密码 语法格式:set password for 'username'@'hostname' = password('new_password'); username:是普通用户名; hostname:是普通用户的主机名; 注意:新密码必须使用password()函数加密; create user 'sww'@'localhost' identified by '123456'; /*创建一个用户*/ select * from