错误:rabbitmq无法启动(Error : rabbitmq failed to start)
我在启动rabbitmq服务器时遇到此错误。 我做了以下步骤,
1)在server1和server2上安装了rabbitmq服务器
2)它成功开始了
3)在服务器2上停止使用,
sudo服务rabbitmq-server停止
4)将/var/lib/rabbitmq/.erlang.cookie从server1复制到server2。
5)尝试在server2上启动rabbitmq但是使用错误
sudo服务rabbitmq-server启动
“rabbitmq未能开始”
6)我试图重置它但收到错误
sudo rabbitmqctl force_reset Forcefully resetting node 'rabbit@IS-21892' ... Error: unable to connect to node 'rabbit@IS-21892': nodedown diagnostics: - nodes and their ports on IS-21892: [{rabbit,54812},{rabbitmqctl11166,34944}] - current node: 'rabbitmqctl11166@IS-21892' - current node home dir: /var/lib/rabbitmq - current node cookie hash: C2ak7NeiCEFHGEZb8SL7+w==
根据文件
http://www.rabbitmq.com/troubleshooting.html
Cookie不匹配是由于不同的用户,rabbitmq和root。
什么是解决方案?
我也试过重新安装。
I am getting this error while starting rabbitmq server. I did following steps,
1) Installed rabbitmq sever on server1 and server2
2) It started successfully
3) Stopped it on server 2 using,
sudo service rabbitmq-server stop
4) copied /var/lib/rabbitmq/.erlang.cookie from server1 to server2.
5) Trying to start rabbitmq on server2 but getting error using
sudo service rabbitmq-server start
"rabbitmq failed to start"
6) I tried to reset it using but getting error
sudo rabbitmqctl force_reset Forcefully resetting node 'rabbit@IS-21892' ... Error: unable to connect to node 'rabbit@IS-21892': nodedown diagnostics: - nodes and their ports on IS-21892: [{rabbit,54812},{rabbitmqctl11166,34944}] - current node: 'rabbitmqctl11166@IS-21892' - current node home dir: /var/lib/rabbitmq - current node cookie hash: C2ak7NeiCEFHGEZb8SL7+w==
According to documentation
http://www.rabbitmq.com/troubleshooting.html
Cookie mismatch is due to different users, rabbitmq and root.
Whats the solution ?
I tried reinstalling as well.
原文:https://stackoverflow.com/questions/21907281
最满意答案
如果您将列表转换为
ndarray
,您可以使用如下广播:coords = np.zeros((5, 5, 30, 2, 4)) coords[..., 0] = np.array(mapLatitude).reshape(5, 1, 1, 1) coords[..., 1] = np.array(mapLongitude).reshape(1, 5, 1, 1) coords[..., 2] = np.array(mapAltitude).reshape(1, 1, 30, 1) coords[..., 3] = np.array(mapTime).reshape(1, 1, 1, 2)
对于更一般的输入,这样的东西应该工作:
def makeCoordinateMatrix(*coords) : dims = len(coords) coords = [np.array(a) for a in coords] shapes = tuple([len(a) for a in coords]) ret = np.zeros(shapes + (dims,)) for j, a in enumerate(coords) : ret[..., j] = a.reshape((len(a),) + (1,) * (dims - j - 1)) return ret coordinateMatrix = makeCoordinateMatrix(mapLatitude, mapLongitude, mapAltitude, mapTime)
If you turn your lists into
ndarray
's you can use broadcasting as follows:coords = np.zeros((5, 5, 30, 2, 4)) coords[..., 0] = np.array(mapLatitude).reshape(5, 1, 1, 1) coords[..., 1] = np.array(mapLongitude).reshape(1, 5, 1, 1) coords[..., 2] = np.array(mapAltitude).reshape(1, 1, 30, 1) coords[..., 3] = np.array(mapTime).reshape(1, 1, 1, 2)
For more general inputs something like this should work:
def makeCoordinateMatrix(*coords) : dims = len(coords) coords = [np.array(a) for a in coords] shapes = tuple([len(a) for a in coords]) ret = np.zeros(shapes + (dims,)) for j, a in enumerate(coords) : ret[..., j] = a.reshape((len(a),) + (1,) * (dims - j - 1)) return ret coordinateMatrix = makeCoordinateMatrix(mapLatitude, mapLongitude, mapAltitude, mapTime)
相关问答
更多-
我现在能看到的最大问题是你迭代地构建了一些数据结构,即source , target和corr 。 您可以通过将对象预分配到正确的大小来极大地加速代码,并使用索引来放置值。 您可以通过矢量化操作来进一步改进代码。 例如,确定m哪些部分大于0.01可以很容易地完成,如下所示: m[m > 0.01] 并获取您的数据结构source , target和corr : matching_indices = which(m > 0.01, arr.ind = TRUE) source = matching_indi ...
-
您可能要查找的是scipy.spatial.distance的代码,特别是cdist函数。 这可以有效地计算各种指标点之间的成对距离。 import numpy as np from scipy.spatial.distance import cdist A = np.random.random((1000, 2)) B = np.random.random((100, 2)) D = cdist(A, B, metric='euclidean') print(D.shape) # (1000, 100 ...
-
您可以为任意维度的NumPy数组实现函数ravel_index() : def ravel_index(x, dims): i = 0 for dim, j in zip(dims, x): i *= dim i += j return i 此函数与函数numpy.unravel_index()的反函数。 对于您的应用程序,您可以将此函数称为ravel_index((x, y, z), m.shape) 。 You can implement a f ...
-
PyQt将鼠标按下的坐标映射到图像的坐标系(PyQt mapping the coordinates of a mouse press to the coordinate system of an image)[2022-02-23]
_default_image_transform的基本思想是正确的。 错误在函数的最后。 def _default_img_transform(self, painter): #size of widget winheight = float(self.height()) winwidth = float(self.width()) #size of pixmap scrwidth = float(self.pixmap.width()) sc ... -
which()接受一个参数arr.ind=TRUE ,它将返回它所应用的逻辑矩阵中的所有TRUE元素的索引。 ## An example matrix set.seed(1) m <- matrix(sample(1:100, 10), ncol=2) m # [,1] [,2] # [1,] 27 86 # [2,] 37 97 # [3,] 57 62 # [4,] 89 58 # [5,] 20 6 ## An example applicatio ...
-
加快矩阵计算(Speed up matrix calculation)[2022-07-13]
计算C * A^(i-1-(j-1)) * B只有一组有限的结果,它只取决于i和j之间的差异。 不重复计算它,我的解决方案迭代这个差异和i,然后根据这两个变量计算j。 Phi=zeros(Np*q,Nc*m); CB = C * B; for diffij=0:Np-1 if diffij>0 F=C * A^diffij * B; else F=CB; end for i=max(1,diffij+1):min(Np,Nc+diffij) ... -
如果您将列表转换为ndarray ,您可以使用如下广播: coords = np.zeros((5, 5, 30, 2, 4)) coords[..., 0] = np.array(mapLatitude).reshape(5, 1, 1, 1) coords[..., 1] = np.array(mapLongitude).reshape(1, 5, 1, 1) coords[..., 2] = np.array(mapAltitude).reshape(1, 1, 30, 1) coords[..., ...
-
编辑:我的原始答案使用了ax.scatter 。 这有一个问题:如果两个点是并排的, ax.scatter可能会在它们之间留出一点空间,具体取决于比例: 例如,用 data = np.array([(2,3),(3,3)]) 这是一个放大的细节: 所以这是一个解决此问题的替代解决方案: import matplotlib.pyplot as plt import numpy as np data = np.array([(2,3),(3,3),(45,4),(3,65)]) N = data.max() ...
-
加速Python迭代(Speeding up Python iteration)[2023-09-22]
python 2.x中的range创建一个列表。 while谓词中的表达式导致每次迭代创建/销毁列表; 因此,创建1,300,000个项目列表1,300,000次。 while idx in range(len(self.zoom_list)): # this is run every iteration ... idx += 1 通过for xrange使用for语句,它将更容易阅读,不会发生列表创建/销毁。 for idx in xrange(len(self.zoom_list)) ... -
OpenGL,World to Object坐标映射?(OpenGL ,World to Object coordinate mapping ? (inverse matrix))[2023-12-31]
反转矩阵将是一般解决方案,但据我所知,这实际上不是一个“一般”问题。 您正在尝试反转已知的转换序列,而不是撤消任意转换,每个转换都可以非常简单地反转。 如果您的对象到世界的转换是: glTranslatef(Ox, Oy, Oz); glRotatef(rotationX , 1.0, 0.0, 0.0); glRotatef(rotationY, 0.0, 1.0, 0.0); glRotatef(rotationZ, 0.0, 0.0, 1.0); 然后世界到对象的逆是: glRotatef(-rot ...