localhost

linux下安装使用etcd

匿名 (未验证) 提交于 2019-12-02 21:59:42
一、简介 : API (gRPC) TLS : 10000 : Raft etcd Go Raft 二、安装 1.方法1 $curl -L https://github.com/coreos/etcd/releases/download/v3.3.2/etcd-v3.3.2-linux-amd64.tar.gz -o etcd-v3.3.2-linux-amd64.tar.gz #解压后是一些文档和两个二进制文件etcd和etcdctl。etcd是server端,etcdctl是客户端。 $tar zxf etcd-v3.3.2-linux-amd64.tar.gz #将解压后的etcd和etcdctl移动到$GOPATH/bin目录下,可以直接使用etcd和etcdctl命令 $mv etcd-v3.3.2-linux-amd64/etcd* /$GOPATH/bin 2. 2 $ mkdir -p $GOPATH/src/github.com/coreos $ cd !$ $ git clone https://github.com/coreos/etcd.git $ cd etcd $ ./build $ ./bin/etcd 三、启动 $ ./etcd (或直接使用etcd) etcd localhost:2379 etcdctl # API 3 $ export

linux虚拟机(centos7)常见配置解析

匿名 (未验证) 提交于 2019-12-02 21:59:42
在win7下安装了多台虚拟机,安装后常用的几个配置记录下,因安全策略,采用的仅主机模式(内网)。 (1)更改主机名称,不是连接的名称,是hostname中的名称,虚拟机版本是:cenos7中最新的7.7.1908。 (2)只需修改 /etc/hostname即可,如下: vi /etc/hostname 默认的local**修改为需要的机器名称,例如本机修改为w158 (3)root用户下执行reboot就会生效。 centos7与linux下的不太一样,没有iptables。 systemctl status firewalld.service #软件老王,查看防火墙状态 systemctl stop firewalld.service #软件老王,停止firewall systemctl disable firewalld.service #软件老王,禁止firewall开机启动 vi /etc/ssh/sshd_config 修改:UseDNS yes,为:UseDNS no 重启ssh: systemctl restart sshd 下载地址: http://www.rpmfind.net/linux/rpm2html/search.php?query=zip(x86-64) http://www.rpmfind.net/linux/rpm2html/search.php

django-channels的部署(supervisor+daphne+nginx)

匿名 (未验证) 提交于 2019-12-02 21:59:42
项目中需要一个聊天室的功能,所以需要websocket通信,选择了使用 channels 模块,主要记录下 channels 部署的配置和一些坑. 原项目是通过nginx+uwsgi部署的,这里我没做任何改动,只是通过Nginx将特定请求路径代理到daphne上.部署前对 django 配置的一些修改可以直接参考 官方文档 ,这个比较简单,也没有什么问题. supervisor + daphne 第一种: 这是我最初在网上查到配置,很多文章基本是类似的: [program:asgi] directory=/your/path/project-name # 项目主路径 command=daphne -b localhost -p 8001 --proxy-headers project-name.asgi:application # 启动命令 autostart=true autorestart=true stdout_logfile=/tmp/asgi.log redirect_stderr=true 需要注意一点,如果项目运行在虚拟环境,supervisor安装在主环境中,那么 daphne 需要用绝对路径. 这种配置是可用的,但有个问题是只能单进程运行,如果打开多个进程(添加 numprocs=n )会报端口占用的错误. 第二种 然后就是 官方的配置

LINUX开启SAMBA服务

匿名 (未验证) 提交于 2019-12-02 21:56:30
samba,用于网络文件共享,类似于nfs, samba多用于win和linux之间 linux之间多用nfs c/s架构 smb协议 samba主要是两个服务,核心启动服务SMB,监听139TCP端口,NMB服务类似DSN功能,如果不启,只能以ip来访问,监听137 138UDP端口 使用 yum - y install samba 然后防火墙 systemctl stop firewalld . service 然后selinux [ root@localhost ~]# sestatus SELinux status : enabled SELinuxfs mount : /sys/ fs / selinux SELinux root directory : /etc/ selinux Loaded policy name : targeted Current mode : enforcing Mode from config file : enforcing Policy MLS status : enabled Policy deny_unknown status : allowed Max kernel policy version : 31 [ root@localhost ~]# setenforce 0 [ root@localhost ~]# sestatus

Linux修改主机名称方法

匿名 (未验证) 提交于 2019-12-02 21:56:30
碰到这个问题的时候,是在安装Zookeeper集群的时候,碰到如下问题 java . net . UnknownHostException : XXXX Name or service not knownjava . net . Inet6AddressImpl . lookupAllHostAddr ( Native Method ) ............ 这里猜想到是主机的地址没有配对,网上给了方案是重新设置linux的主机名。 注:如何修改linux主机名才能生效? 1.hostname +主机名 (这个只是做为暂时的,重启后将恢复到原来的名字.) 2.很多人说修改/etc/hosts文件,其实这个文件里的主机名只是为来提供给dns解析的.如果你用不上dns,只需要修改主机名,那修改这个没用. 3..修改这个文件etc/sysconfig/network这个文件里的主机名.(重启后生效) Step1:查看当前的主机名 [ root@sxl133 Desktop ]# hostname sxl133 或者 [ root@sxl133 Desktop ]# hostnamectl [ root@sxl133 Desktop ]# hostnamectl set - hostname sxl133 这里的主机名是sxl133,如果没有设置,则是localhost

Linux 服务控制与运行级别

匿名 (未验证) 提交于 2019-12-02 21:56:30
如何控制服务的运行状态?如何切换不同的运行级别? ntsysv 仿图形交互界面,集中配置各种服务启动状态 --level 35 :同时对指定运行级别中的服务进行管理,不加仅管理当前运行级别中的服务。 [root@localhost ~]# ntsysv --level 35 systemctl systemctl {选项} name.servive start :启动 stop :停止 [root@localhost ~]# systemctl start httpd.service [root@localhost ~]# systemctl stop httpd.service restart :重启,先停止,再启动 reload :重新加载配置文件,不会完全停止和启动服务 [root@localhost ~]# systemctl restart httpd.service [root@localhost ~]# systemctl reload httpd.service status :状态 is-active :是否启动成功 is-failed :是否启动失败 [root@localhost ~]# systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded

Linux基础命令---显示主机名hostname

匿名 (未验证) 提交于 2019-12-02 21:56:30
hostname 此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。 1 、语法 选项] 2 、选项列表 选项 说明 -h | --help 显示帮助文档 -V | --version 显示命令版本 -v 显示详细执行过程 -a | --alias 显示主机别名 -d | --domain 显示主机dns域名 -F file 从文件读取 -f | --fqdn | --long 显示完全格式的域名 -A | --all-fqdns 显示机器的全部FQDNs -i | --ip-address 显示指定主机的ip地址 -I | --all-ip-address 显示主机所有的地址 -s | --short 以短格式显示,仅显示从第一个点分开的部分 -y | --yp | --nis 显示nis域名 3 、FQDN hostname -fqdn ”、“ ”和“ dnsdomainname ”。“ hostname --ip-address ”地址也受到同样的限制,因此也应该避免。 4 、实例 1)显示主机名 显示完整名字 localhost.localdomain 显示短格式名字 显示主机别名 localhost.localdomain localhost4 localhost4.localdomain4 localhost

error executing hyperledger fabric code on localhost:3000 (through REST) - transactionId

。_饼干妹妹 提交于 2019-12-02 21:56:27
问题 I have tried executing a sample case of transfer of money between two accounts while referring to this: https://medium.freecodecamp.org/ultimate-end-to-end-tutorial-to-create-an-application-on-blockchain-using-hyperledger-3a83a80cbc71 I have executed all steps, from creating .bna and .card to installing them, starting the network etc. On creating the RESTful API, I am able to see the blockchain on localhost:3000/explore. I am also able to add customers and their linked account details.

浅谈location对象

匿名 (未验证) 提交于 2019-12-02 21:53:52
Location 对象存储在 Window 对象的 Location 属性中,表示那个窗口中当前显示的文档的 Web 地址。通过Location对象,可以获取URL中的各项信息,调用对象方法也可以重新加载或替换当前文档。 在控制台输入 window.location 可以获取Location对象的详细信息: href href 属性是最常用的一种属性,通过 window.location.href 可以获取完整的URL。Location的对象属性都有一个特点,即对象属性都是 writable ,可以通过属性值的替换来重新设置属性值。这也引出了对象属性最常用的一种用法,通过重新设置 href 属性来跳转网页。 window.location.href = "www.baidu.com" 众所周知,所有浏览器全都采取同源策略,即: 协议相同 域名相同 端口相同 协议、域名、端口在Location对象中分别对应的属性是: protocol , hostname , port window.location.href // http://localhost:8080/#/b?a=1 window.location.protocol // http: window.location.hostname // localhost window.location.port // 8080 很多时候

微服务下使用网关 Spring Cloud Gateway

匿名 (未验证) 提交于 2019-12-02 21:53:52
Spring Cloud Gateway 工作原理 客户端向 Spring Cloud Gateway 发出请求,如果请求与网关程序定义的路由匹配,则将其发送到网关 Web 处理程序,此处理程序运行特定的请求过滤器链。 过滤器之间用虚线分开的原因是过滤器可能会在发送代理请求之前或之后执行逻辑。所有 "pre" 过滤器逻辑先执行,然后执行代理请求,代理请求完成后,执行 "post" 过滤器逻辑。 如何启动 Spring Cloud Gateway 1、新建 Maven 工程,添加相关依赖 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.anoyi</groupId> <artifactId>core-gateway</artifactId>