小编Fra*_*oni的帖子

在不同的端口上运行 PostgreSQL docker 镜像


我试图在不同的端口上运行 PostgreSQL 实例,方法是将端口设置为 '-p' 中的参数,但它似乎没有任何效果。前任:

docker run --name db_Dev -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgresDev -p 7432:7432 postgres:10.5
Run Code Online (Sandbox Code Playgroud)

输出:

2019-09-15 17:50:29.494 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2019-09-15 17:50:29.494 UTC [1] LOG:  listening on IPv6 address "::", port 5432
Run Code Online (Sandbox Code Playgroud)

知道如何为其设置不同的端口吗?谢谢

postgresql docker

5
推荐指数
1
解决办法
989
查看次数

在每一行的末尾添加一个逗号

我需要通过在每行末尾添加一个逗号来格式化邮件列表。已经问过这个问题,但是我没有得到建议答案的预期结果:

sed '$!s/$/,/' file > out.txt
Run Code Online (Sandbox Code Playgroud)

结果是:

user1@gmail.com
,
user2@gmail.com
,
user3@yahoo.fr
. . .
Run Code Online (Sandbox Code Playgroud)

无论如何它可以改进吗?我更需要:

user1@gmail.com,
user2@gmail.com,
user3@yahoo.fr,
. . .
Run Code Online (Sandbox Code Playgroud)

谢谢!

bash sed

4
推荐指数
1
解决办法
7066
查看次数

Spring Boot JMS Producer 中的错误:AMQ212054 目标地址被阻止

我正在尝试使用 Spring Boot 2.1.1.RELEASE 连接到远程 Artemis 2.6.3 发件人。到目前为止,在我发现的所有示例中,发件人在尝试发送消息时挂起(例如https://grokonez.com/spring-framework/spring-jms/apache-artemis-produceconsume-jms-messages-springboot-阿尔忒弥斯应用程序)。控制台显示如下日志:

AMQ212054: Destination address=springbootQueue is blocked. If the system is configured to block make sure you consume messages on this configuration.
Run Code Online (Sandbox Code Playgroud)

我已经验证队列尚未在 broker.xml 中配置为 BLOCK。spring-boot-starter-artemis/Artemis 中是否有任何错误?

更新:我的 broker.xml

<?xml version='1.0'?>

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xi="http://www.w3.org/2001/XInclude"
               xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

   <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:activemq:core ">

      <name>0.0.0.0</name>


      <persistence-enabled>true</persistence-enabled>

      <journal-type>ASYNCIO</journal-type>

      <paging-directory>data/paging</paging-directory>

      <bindings-directory>data/bindings</bindings-directory>

      <journal-directory>data/journal</journal-directory>

      <large-messages-directory>data/large-messages</large-messages-directory>

      <journal-datasync>true</journal-datasync>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>10</journal-pool-files>

      <journal-file-size>10M</journal-file-size>

      <journal-buffer-timeout>156000</journal-buffer-timeout>

      <journal-max-io>4096</journal-max-io>

      <disk-scan-period>5000</disk-scan-period>

      <max-disk-usage>90</max-disk-usage>

      <critical-analyzer>true</critical-analyzer>

      <critical-analyzer-timeout>120000</critical-analyzer-timeout>

      <critical-analyzer-check-period>60000</critical-analyzer-check-period>

      <critical-analyzer-policy>HALT</critical-analyzer-policy>

      <acceptors>

         <!-- Acceptor for every supported protocol -->
         <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>

         <!-- …
Run Code Online (Sandbox Code Playgroud)

spring-boot activemq-artemis

2
推荐指数
1
解决办法
1627
查看次数

Vagrant 如何强制 libvirt 使用不同的网络接口

我使用 Vagrant 定义具有静态 IP 地址的 Fedora 机器。

Vagrant.configure("2") do |config|
  config.vm.network :public_network, :bridge => 'enp0s25', :dev => 'enp0s25'
  config.vm.network "private_network", ip: "192.168.122.1"
  config.vm.provision "shell", inline: "ifconfig"
  config.vm.define "fedora1" do |fedora1|
    fedora1.vm.box = "fedora/23-cloud-base"
  end
end
Run Code Online (Sandbox Code Playgroud)

问题是,如果我尝试配置虚拟机,则会出现错误:

调用 virDomainCreateWithFlags 失败:无法获取接口 eth0 的索引:没有此类设备

事实上,我的 Fedora 21 上没有 eth0,但是

enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.1.71.85  netmask 255.255.255.0  broadcast 10.1.71.255
        inet6 fe80::6af7:28ff:fef3:b97d  prefixlen 64  scopeid 0x20<link>
        ether 68:f7:28:f3:b9:7d  txqueuelen 1000  (Ethernet)
        RX packets 1753807  bytes 1271298509 (1.1 GiB)
        RX errors 0  dropped 26  overruns …
Run Code Online (Sandbox Code Playgroud)

libvirt vagrant

1
推荐指数
1
解决办法
6751
查看次数

Java中通过Socket发送HTTP/2请求


我需要通过 TCP 套接字从我的 Java 类发送 HTTP/2 请求。我已经适配了一段适用于普通 HTTP/1.1 的代码。但是,使用 HTTP/2 时,它不会输出任何响应或错误代码。

你能看出其中有什么问题吗?我试图访问的服务器位于https://localhost:8443

Socket s = new Socket(InetAddress.getByName("localhost"), 8443);
PrintWriter pw = new PrintWriter(s.getOutputStream());
pw.print("GET / HTTP/2.0\r\n");
pw.print("Host: localhost:8443\r\n\r\n");
pw.flush();
BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
String t;
while((t = br.readLine()) != null) System.out.println(t);
br.close();
Run Code Online (Sandbox Code Playgroud)

谢谢!

java http2

0
推荐指数
1
解决办法
1658
查看次数