Amazon ec2 Drupal 7+;AWS负载平衡器,具有EC2+;缺少临时文件夹文件

Amazon ec2 Drupal 7+;AWS负载平衡器,具有EC2+;缺少临时文件夹文件,amazon-ec2,drupal-7,elastic-load-balancer,Amazon Ec2,Drupal 7,Elastic Load Balancer,我正在使用带有弹性负载平衡器的AWS EC2服务。当我尝试使用plupload上载多个图像时,返回错误: 指定的文件temporary://p1ccn4f5o41dmh1qvmefo1ohv1dq15.tmp 无法复制,因为不存在同名文件。请检查您提供的文件名是否正确。该网站遇到意外错误。请稍后再试 我正在为我的Drupal站点使用2 EC2服务器并行,并在加载AWS时创建新的2 EC2实例。所以当站点满负荷运行时,有4台EC2服务器正在运行 只有当2个或多个Ec2实例正在运行且tmp文件夹与单

我正在使用带有弹性负载平衡器的AWS EC2服务。当我尝试使用plupload上载多个图像时,返回错误:

指定的文件temporary://p1ccn4f5o41dmh1qvmefo1ohv1dq15.tmp 无法复制,因为不存在同名文件。请检查您提供的文件名是否正确。该网站遇到意外错误。请稍后再试

我正在为我的Drupal站点使用2 EC2服务器并行,并在加载AWS时创建新的2 EC2实例。所以当站点满负荷运行时,有4台EC2服务器正在运行

只有当2个或多个Ec2实例正在运行且tmp文件夹与单个Ec2服务器配合正常时,才会出现此问题

如何为多实例网站配置tmp

OP评论中的信息:

我正在使用ELB with strike$\u会话来维护与特定EC2实例的用户连接。

我研究了AWS服务上的多文档,发现我们需要维护与特定EC2实例的用户连接

Use the following create-lb-cookie-stickiness-policy command to create a load balancer-generated cookie stickiness policy with a cookie expiration period of 60 seconds:

aws elb create-lb-cookie-stickiness-policy --load-balancer-name my-loadbalancer --policy-name my-duration-cookie-policy --cookie-expiration-period 60

Use the following set-load-balancer-policies-of-listener command to enable session stickiness for the specified load balancer:

aws elb set-load-balancer-policies-of-listener --load-balancer-name my-loadbalancer --load-balancer-port 443 --policy-names my-duration-cookie-policy

Note

The set-load-balancer-policies-of-listener command replaces the current set of policies associated with the specified load balancer port. Every time you use this command, specify the --policy-names option to list all policies to enable.

(Optional) Use the following describe-load-balancers command to verify that the policy is enabled:

aws elb describe-load-balancers --load-balancer-name my-loadbalancer

The response includes the following information, which shows that the policy is enabled for the listener on the specified port:

{
    "LoadBalancerDescriptions": [
        {
            ...
            "ListenerDescriptions": [
                {
                    "Listener": {
                        "InstancePort": 443, 
                        "SSLCertificateId": "arn:aws:iam::123456789012:server-certificate/my-server-certificate", 
                        "LoadBalancerPort": 443, 
                        "Protocol": "HTTPS", 
                        "InstanceProtocol": "HTTPS"
                    }, 
                    "PolicyNames": [
                        "my-duration-cookie-policy", 
                        "ELBSecurityPolicy-2016-08"
                    ]
                },
                ...
            ],            
            ...
            "Policies": {
                "LBCookieStickinessPolicies": [
                 {
                        "PolicyName": "my-duration-cookie-policy", 
                        "CookieExpirationPeriod": 60
                    }

                ], 
                "AppCookieStickinessPolicies": [], 
                "OtherPolicies": [
                    "ELBSecurityPolicy-2016-08"
                ]
            },
            ...
        }
    ]
}
经典的负载平衡器将每个请求独立地路由到负载最小的注册实例。但是,您可以使用sticky session功能(也称为session affinity),它使负载平衡器能够将用户的会话绑定到特定实例。这确保了会话期间来自用户的所有请求都发送到同一实例

Use the following create-lb-cookie-stickiness-policy command to create a load balancer-generated cookie stickiness policy with a cookie expiration period of 60 seconds:

aws elb create-lb-cookie-stickiness-policy --load-balancer-name my-loadbalancer --policy-name my-duration-cookie-policy --cookie-expiration-period 60

Use the following set-load-balancer-policies-of-listener command to enable session stickiness for the specified load balancer:

aws elb set-load-balancer-policies-of-listener --load-balancer-name my-loadbalancer --load-balancer-port 443 --policy-names my-duration-cookie-policy

Note

The set-load-balancer-policies-of-listener command replaces the current set of policies associated with the specified load balancer port. Every time you use this command, specify the --policy-names option to list all policies to enable.

(Optional) Use the following describe-load-balancers command to verify that the policy is enabled:

aws elb describe-load-balancers --load-balancer-name my-loadbalancer

The response includes the following information, which shows that the policy is enabled for the listener on the specified port:

{
    "LoadBalancerDescriptions": [
        {
            ...
            "ListenerDescriptions": [
                {
                    "Listener": {
                        "InstancePort": 443, 
                        "SSLCertificateId": "arn:aws:iam::123456789012:server-certificate/my-server-certificate", 
                        "LoadBalancerPort": 443, 
                        "Protocol": "HTTPS", 
                        "InstanceProtocol": "HTTPS"
                    }, 
                    "PolicyNames": [
                        "my-duration-cookie-policy", 
                        "ELBSecurityPolicy-2016-08"
                    ]
                },
                ...
            ],            
            ...
            "Policies": {
                "LBCookieStickinessPolicies": [
                 {
                        "PolicyName": "my-duration-cookie-policy", 
                        "CookieExpirationPeriod": 60
                    }

                ], 
                "AppCookieStickinessPolicies": [], 
                "OtherPolicies": [
                    "ELBSecurityPolicy-2016-08"
                ]
            },
            ...
        }
    ]
}
管理用户请求和EC2实例之间的会话,我们需要配置粘性会话

管理粘性会话的关键是确定负载平衡器应持续将用户请求路由到同一实例的时间。如果应用程序有自己的会话cookie,则可以配置弹性负载平衡,以便会话cookie遵循应用程序会话cookie指定的持续时间。如果应用程序没有自己的会话cookie,则可以通过指定自己的粘滞持续时间来配置弹性负载平衡以创建会话cookie

弹性负载平衡创建一个名为AWSELB的cookie,用于将会话映射到实例

Use the following create-lb-cookie-stickiness-policy command to create a load balancer-generated cookie stickiness policy with a cookie expiration period of 60 seconds:

aws elb create-lb-cookie-stickiness-policy --load-balancer-name my-loadbalancer --policy-name my-duration-cookie-policy --cookie-expiration-period 60

Use the following set-load-balancer-policies-of-listener command to enable session stickiness for the specified load balancer:

aws elb set-load-balancer-policies-of-listener --load-balancer-name my-loadbalancer --load-balancer-port 443 --policy-names my-duration-cookie-policy

Note

The set-load-balancer-policies-of-listener command replaces the current set of policies associated with the specified load balancer port. Every time you use this command, specify the --policy-names option to list all policies to enable.

(Optional) Use the following describe-load-balancers command to verify that the policy is enabled:

aws elb describe-load-balancers --load-balancer-name my-loadbalancer

The response includes the following information, which shows that the policy is enabled for the listener on the specified port:

{
    "LoadBalancerDescriptions": [
        {
            ...
            "ListenerDescriptions": [
                {
                    "Listener": {
                        "InstancePort": 443, 
                        "SSLCertificateId": "arn:aws:iam::123456789012:server-certificate/my-server-certificate", 
                        "LoadBalancerPort": 443, 
                        "Protocol": "HTTPS", 
                        "InstanceProtocol": "HTTPS"
                    }, 
                    "PolicyNames": [
                        "my-duration-cookie-policy", 
                        "ELBSecurityPolicy-2016-08"
                    ]
                },
                ...
            ],            
            ...
            "Policies": {
                "LBCookieStickinessPolicies": [
                 {
                        "PolicyName": "my-duration-cookie-policy", 
                        "CookieExpirationPeriod": 60
                    }

                ], 
                "AppCookieStickinessPolicies": [], 
                "OtherPolicies": [
                    "ELBSecurityPolicy-2016-08"
                ]
            },
            ...
        }
    ]
}
请回答您的问题以添加信息。如果您将其隐藏在注释中,它可能会丢失。特别是如果它们是关于非答案的评论,这些评论迟早会被删除。